All I basically need is for it to recognize what the file type/extension is. Using this code I always get the die code.
Here is what I use to input the file
<input type='file' name='file'>
here is a sniplet of my code
$file_type = $_FILES['file']['type'];
$ext = array('.jpg','.jpeg','.gif','.bmp');
if (!in_array($file_type, $ext)) {
echo "Error, not a valid file type<br>";
echo "You tried to upload $file_type";
exit;
} else {
//do stuff
}
THANKS!