PHP - Maximum Total Upload Size?

后端 未结 10 1434
说谎
说谎 2020-12-09 13:58

I have a php web page with 15 fields. The user will use it to upload images. I tested this by uploading 15 jpg images, each about 2 M, without any problems. On the day I

相关标签:
10条回答
  • 2020-12-09 14:19

    If you are using nginx then make sure that you have the following:

    server {
    ...
         client_max_body_size 100M;
    ....
    }
    
    0 讨论(0)
  • 2020-12-09 14:21

    The upload limits are set through php ini. You can try get them like so:

    $post_max_size = ini_get('post_max_size');
    $upload_max_filesize = ini_get('upload_max_filesize');
    
    0 讨论(0)
  • 2020-12-09 14:24

    It's a setting in php.ini. You can look in the output of php info for the field labeled "upload_max_filesize". To get a php info page, create a php file with the following code:

    <?php phpinfo(); ?>
    

    This post at php.net gives you sample code to get that information, and the rest of the page is a treasure trove of php configuration options.

    0 讨论(0)
  • 2020-12-09 14:29

    This would be unusual, but of course, check with whatever hosting company you choose. If there were a limit, it certainly would be higher than 30 MB.

    0 讨论(0)
提交回复
热议问题