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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.