Thread: Image Uploading
View Single Post
Old 02-04-2008, 06:43 PM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

You state that people shouldn't rely on the MIME type passed along with the uploaded file, because it is not checked for authenticity and can be forged, but have no qualms with 'trusting' the file extension?

Also, using an alternative method, the extension can be grabbed with: $ext = pathinfo($filename, PATHINFO_EXTENSION);

Finally, to answer the original question posed by Orc, $_FILES[...]['name'] will contain the name of the file as sent by the browser (eg. myimage.jpg), extension and all.
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Orc (02-06-2008)