Jabbamonkey
08-20-2002, 12:48 AM
I'm having a user upload a file. If the file isn't an image file, I want to send them an error message. I tried the following...
if ($file_type != "image/gif" || $file_type != "image/pjpeg" || $file_type != "image/jpeg")
{ $error = "File Error - Not an image file (".$file_type.")"; }
if ($error) { echo $error; }
Unfortunately, I keep getting my error message ...
File Error - Not an image file (image/pjpeg)
... but that IS what the file type is ... I'm confused. Anyone know why this is happening? Did I miss something ... I've been staring at this code for so long...
if ($file_type != "image/gif" || $file_type != "image/pjpeg" || $file_type != "image/jpeg")
{ $error = "File Error - Not an image file (".$file_type.")"; }
if ($error) { echo $error; }
Unfortunately, I keep getting my error message ...
File Error - Not an image file (image/pjpeg)
... but that IS what the file type is ... I'm confused. Anyone know why this is happening? Did I miss something ... I've been staring at this code for so long...