aashcool198 Posted July 3, 2009 Share Posted July 3, 2009 Hi All, i have a file-upload script and this is code for restricting file types it is accepting pdf but denying docx.. please tell me what is going wrong. if ((($_FILES["file"]["type"] == "application/pdf") || ($_FILES["file"]["type"] == "application/doc") || ($_FILES["file"]["type"] == "application/docx")) && ($_FILES["file"]["size"] < 200000)) Link to comment https://forums.phpfreaks.com/topic/164630-file-upload-restriction/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 3, 2009 Share Posted July 3, 2009 When a comparison fails, the only 100% sure way to find out why is to display the actual value that is failing the test. Try this debugging code before your existing logic to see what you are actually receiving - echo "<pre>"; echo "FILES:"; print_r($_FILES); echo "</pre>"; Link to comment https://forums.phpfreaks.com/topic/164630-file-upload-restriction/#findComment-868214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.