Thread: File upload
View Single Post
Old 02-20-2004, 07:00 PM   #3 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
I also recently built a script to upload strictly image files (jpg|png|gif) and did it using an array with the MIME types compared against the value of $_FILES['file]['type'] ( or $_FILES[0]['type'] of course ).

example (excerpt from the real script)
PHP Code:
$allowed_types = array('image/png''image/jpeg''image/pjpeg''image/gif');
if ( !
in_array($_FILES['file']['type'], $allowed_types) )
{
    
// not the right MIME type, do something


Regarding converting the file type; are you talking about a wireless bitmap (WBMP) file or a windows bitmap (BMP) image file?
bdl is offline   Reply With Quote