kzhao14
kzhao14

Reputation: 2630

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.

Upvotes: 1

Views: 1523

Answers (1)

KHansen
KHansen

Reputation: 930

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.

Upvotes: 1

Related Questions