Fine-Uploader aborting upload with 'File is empty' error

十年热恋 提交于 2019-12-04 17:51:57

If you are experiencing this (rather unhelpful) error, it could be a number of things, so I'd advise checking them all. This answer is in the context of 'very large' files where this error seems to occur.

In your php.ini, check to ensure that:

post_max_size is set high enough to cover the file size (max 2G)

upload_max_filesize is set high enough to cover the file size (max 2G)

That post_max_size is larger than upload_max_filesize (as recommended by http://www.php.net/manual/en/ini.core.php#ini.post-max-size), and that memory_limit is larger than post_max_size. Any of these factors could result in the $_FILES superglobal returning as empty, and erroring out the upload.

Other things to try in php.ini:

That max_execution_time is increased to take in to account the duration of the upload (large files typically take longer than the default of 30), and max_input_time is also increased accordingly.

You may also need to modify your httpd.conf with the LimitRequestBody directive as this may be overriding anything specified in php.ini. This is specified in bytes and can be specified either directly in httpd.conf or in a .htaccess file (assuming you have Override priviliges). You can also specify this on a per-directory basis (for security) as follows.

<Directory "/var/www/myuploaddir/">
        LimitRequestBody 1073741824
</Directory>

Finally, also ensure that you have sufficient temporary and non-temporary storage for the file being uploaded. The package does not catch 'out of space' errors.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!