File type of a file in an archive

Hi there,

is it possible to check the file type/ extension of an uploaded file that is in an archive with php? So that you can ban file types like .exe.


You could use mime_content_type() or the newer finfo_file()

These will (should) give you mime information to determine what you need.

Also you should actually consider checking the name of the file (for the obvious exe, etc…) as well. You could use regular expressions, substrings, etc… to do this.

Sponsor our Newsletter | Privacy Policy | Terms of Service