Sunday, June 26

What is the significance of MAX_FILE_SIZE in file uploads

What does
<input type="hidden" name="MAX_FILE_SIZE' value="4194304" /> actually do?

I found the answer here

The value parameter is in bytes

If you upload a file size greater than 4MB you will never get a client side warning (as expected). The main purpose of this is to impose a soft limit on server side.

if you have imposed a MAX_FILE_SIZE of 2MB and the user tries to upload a 4MB file, once they reach roughly the first 2MB of upload, the transfer will terminate and the PHP will stop accepting more data for that file. It will report the error on the files array.

It's only supposed to send the information to the server. The reason that it must precede the file field is that it has to come before the file payload in the request for the server to be able to use it to check the size of the upload.

Be the first one to Comment!!!

Post a Comment