简体   繁体   中英

JQuery AJAX upload file does not work with files more than 10 MB

I've been stumped with this issue for the past 3 hours. I've looked at countless guides and posts to no avail.

I have a system where users are able to upload files. Once they select a file, I want to upload the file (via PHP file) and show the user the upload progress. I've tried to do this using $.ajax (using FormData) and JQuery Form plugin. They both work with smaller files that are less than 10 MB, but I've found that when I try to upload a file that's more than 10 MB my PHP file receives none of the information ( $_POST or $_FILE ).

How can I fix this issue, or how can I allow users to upload files and show them an accurate upload progress bar?

Thanks in advance.

You should check two vars in your PHP script:

ini_get('post_max_size') , ini_get('upload_max_filesize') and if the user is able to upload multiple files ini_get('max_file_uploads') . If one or all limits are below your expectations you should raise them in your php.ini

Edit: Added upload_max_filesize to the list.

运行ini_get('post_max_size')我发现托管公司将其限制为8MB ,因此我使用php_value post_max_size 128M通过.htaccess将其增加到128MB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM