After ajax uses formdata to submit a form and finds that the file value in php is exceeded, php cannot obtain the files submitted by the form and other postdata data. It can be obtained without exceeding the limit, but normal form submission seems to be able to obtain the information of the uploaded file. After ajax uses form data to submit a form and finds that the file value in php is exceeded, php cannot obtain files submitted by the form and other post data.
It can be obtained without exceeding the limit, but normal form submission seems to be able to obtain the information of the uploaded file.
Reply content:
After ajax uses form data to submit a form and finds that the file value in php is exceeded, php cannot obtain files submitted by the form and other post data.
It can be obtained without exceeding the limit, but normal form submission seems to be able to obtain the information of the uploaded file.
If the file is too large, you should first restore the file on the front-end. if it is a simple upload, the backend obtains the size of the uploaded file:
If ($ _ FILES ['file'] ['size']> 10485760) {// bytes equals 10 mb // do something}
If the server isnginx
If the number of uploaded files exceedsclient_max_body_size
The value set by the parameter. this request will not be forwarded to PHP for processing. it will be intercepted at the server level. it may be related to your situation!
Post_max_size and upload_max_filesize are set in php. ini. after the configured size is exceeded, the request cannot be processed properly by PHP.
Ajax cannot upload files.
If you are using jQuery, consider the plug-in ajaxFileUpload.