uploading script (the basics)
Posted: Wed Feb 21, 2007 8:48 pm
I have created a very basic file uploading script. What is needed in order to limited file size and accept only certain file extensions?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Excellent! You can post your code in the Code Critique and get valuable input on your code.jkashu wrote:I have created a very basic file uploading script.
There is a MAX_FILE_SIZE parameter you can use in your form. However that does not prevent malicious circumvention. PHP has a ini setting for max_upload_size the is probably a better ultimate limiter. Best is to check the actual size of the temporary uploaded file and don't move it unless it is it your allowed size range.jkashu wrote:What is needed in order to limited file size
The extension will not prevent malicious circumvention. You should inspect the actual file to determine its type. PHP has several functions for this.jkashu wrote: and accept only certain file extensions?