BigAl75 Posted April 20, 2009 Share Posted April 20, 2009 I found this: if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/pjpeg")) but what if I want to allow .pdf & .doc files. What would I put in place of the "image/ext". I'm guessing it's not "image/pdf". Link to comment Share on other sites More sharing options...
justsomeguy Posted April 20, 2009 Share Posted April 20, 2009 How about this instead: $ext = strtolower(array_pop(explode('.', $_FILES['file']['name'])));if ($ext == 'gif' || $ext == 'jpg' || $ext == 'jpeg' || $ext == 'pdf') Link to comment Share on other sites More sharing options...
jeffman Posted April 20, 2009 Share Posted April 20, 2009 You can Google "mime types" for a complete list. For pdf the answer is:application/pdf Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.