phpretard Posted January 9, 2008 Share Posted January 9, 2008 I am trying to allow only pdf and jpeg files to be uploaded and as usual it doesn't work. Here is the code im using. I set the file size high to eliminate it as a problem. I can't figure out what goes ($_FILES["ufile"]["type"] == "HERE/pdf") if ((($_FILES["ufile"]["type"] == "/pdf") || ($_FILES["ufile"]["type"] == "image/jpeg") || ($_FILES["ufile"]["type"] == "image/pjpeg")) && ($_FILES["ufile"]["size"] < 2000000000)) any thoughts? I worked with it for a long time before I decided to bother you all with it. Thank you for help! -Anthony Link to comment https://forums.phpfreaks.com/topic/85232-solved-validate-pdf/ Share on other sites More sharing options...
rhodesa Posted January 9, 2008 Share Posted January 9, 2008 should be application/pdf Link to comment https://forums.phpfreaks.com/topic/85232-solved-validate-pdf/#findComment-434816 Share on other sites More sharing options...
phpretard Posted January 9, 2008 Author Share Posted January 9, 2008 THANK YOU!! Link to comment https://forums.phpfreaks.com/topic/85232-solved-validate-pdf/#findComment-434827 Share on other sites More sharing options...
rhodesa Posted January 9, 2008 Share Posted January 9, 2008 If you ever want to know the TYPE of a file, just change your code to print the type when you upload. if($_FILES["ufile"]) echo $_FILES["ufile"]["type"]; Link to comment https://forums.phpfreaks.com/topic/85232-solved-validate-pdf/#findComment-434835 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.