File uploads

A

Anonymous

Guest
Hi,

I would like to know if there is any way of forbidding certain files for upload (such as .exe or .dll) other than manually checking the extension and comparing it to a list of "bad" extensions.

Thanks in advance.
 
there are a few options,
1. If php is running on linux, you can use system function and then use file command... to determine its type
2. or else u got to parse the last charecter sequence after the last dot.
 
mime_content_type() works on linux servers, and will give you the mime of any file.
 
Back
Top