robert_gsfame Posted December 5, 2009 Share Posted December 5, 2009 $filename=$_FILES['file']['name']; $filetype=$_FILES['file']['type']; $filesize=$_FILES['file']['size']; if(empty($filename)){ $warning="No file uploaded</font>";}else if((!empty($filename))&&($filetype!='application/doc')&&($filetype!='application/msword')){ $warning="Word document only!"; }else if((!empty($filename))&&($filesize>60000)){ $warning="File size exceeds maximum"; }else{ echo $fileName;} But i always stuck with the second part as i've uploaded the doc format file and i always got the warning "Word document only" Which part is wrong??thx Quote Link to comment https://forums.phpfreaks.com/topic/184055-upload-doc-problem/ Share on other sites More sharing options...
robert_gsfame Posted December 5, 2009 Author Share Posted December 5, 2009 i tried using IE and it works but when running on mozilla didn't work I've tried the code before no problem occured for both browsers but when i try to run the script today, it didnt run in mozilla What's wrong Quote Link to comment https://forums.phpfreaks.com/topic/184055-upload-doc-problem/#findComment-971729 Share on other sites More sharing options...
PFMaBiSmAd Posted December 5, 2009 Share Posted December 5, 2009 The error messages you display when validating external data should also display the value that failed so that you get feedback as to why the validation test failed. How else would you know why the test failed? Quote Link to comment https://forums.phpfreaks.com/topic/184055-upload-doc-problem/#findComment-971730 Share on other sites More sharing options...
robert_gsfame Posted December 5, 2009 Author Share Posted December 5, 2009 i don't have any idea, could you please help me Quote Link to comment https://forums.phpfreaks.com/topic/184055-upload-doc-problem/#findComment-971731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.