|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
Importance of MAX_FILE_SIZE when uploading files In short, Use it, it is important. How to use it 1- Make sure the hidden field <input type="hidden" name="MAX_FILE_SIZE" value="1048576"> appears before the file upload box (The form field of type "file")
1048576B = 1MB
the value in PHP.INI is the hard limit, this is not a security measure or anything and it can be fooled easily, but all modern browsers that i know of will send the html form data in the order they appear in the form. So with this above the upload box, it will arrive to PHP before the file so that PHP can end execution and spare your visitor the time needed to upload a file that is sure to FAIL due to the limit Also note that you can sometimes (depending on how much privilages you have on the server) set the hard limit within the page, or in an htaccess file in an htaccess file you would do something similar to php_value upload_max_filesize 10M
|
|||||||||||||||||||||||||||||
| XFREETUTORIALS.COM | ||||||||||||||||||||||||||||||