Jump to content

Upload not working well in Mozilla


robert_gsfame

Recommended Posts

i allow users to upload their document * doc format and stored inside folder

and i've put some limitation that document other than * doc format cannot be uploaded using this script

 

$filetype=$_FILES['file']['type'];

if($filetype!='application/msword'){

echo "doc* format only";}else{

COPY FILES INTO FOLDER

 

but the problem is that when i try to upload the * doc format file, "doc* format only" appear and file not copied into the folder

 

This just happened in MOZILLA browser ! but it works well in IE 6.0

 

What is wrong with the code, can anyone give some solution regarding this problem??

 

 

Link to comment
https://forums.phpfreaks.com/topic/184068-upload-not-working-well-in-mozilla/
Share on other sites

Different browsers sometimes use different MIME types. Echo out $_FILES['file']['type'] when uploading a document that you know to be valid. Then see where to go from there. You should see that it isn't applicatoin/msword so you can just check if it's equal to application/msword || 'whatever'. This is one of the reasons it's important to test your code on as many different browsers as possible.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.