Forum Moderators: coopster
I would like to restrict the users from uploading photos more than 2MB of size. Currently I use filesize() function to get the file size but it appears that file is first being uploaded on the server, then checking the size (this takes a few seconds or minute, depending on the filesize) and showing the error accordingly.
Please help me out.
Signed java and activex apps can see files but that's a crazy way to do it.
You can insert a hidden value in your form that some browsers and PHP will obey:
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" /> But remember it can be overridden by hackers so always check server side.
[edited by: amznVibe at 3:49 pm (utc) on Nov. 7, 2008]