After Ajax submits the form using form data, PHP cannot get the files and other post data that the form submitted, after discovering that the file values set in PHP are exceeded.
No more than can be obtained, but the normal form submission seems to be able to get uploaded file information.
Reply content:
After Ajax submits the form using form data, PHP cannot get the files and other post data that the form submitted, after discovering that the file values set in PHP are exceeded.
No more than can be obtained, but the normal form submission seems to be able to get uploaded file information.
If the file is a big problem, it should be in front of the first to detect, if the simple backend to get the file size:
if($_FILES['file']['size'] > 10485760) { // 這裡是 bytes 等於 10mb // do something}
If the server is nginx
, the upload file exceeds client_max_body_size
The parameter set value, this request will not be forwarded to PHP processing, at the server level is intercepted, visual inspection of your situation may be related to this!
PHP.ini set in the Post_max_size and Upload_max_filesize, beyond the size of the set, the request can not be normal processing by PHP.
Ajax cannot upload files.
If you are jquery you can consider plugin Ajaxfileupload