Jump to content

Recommended Posts

Your error checking and error reporting logic in your code should tell you why the upload is failing so that you don't have to guess.

 

Best guess is that you are checking the mime type and different browsers send different mime types for the same file (actually some send a more correct mime type, others send a more general mime type.)

That doesn’t seem to be the problem, do you think it has something to do with the file extension, because when it's not working for me on IE it's saying the error which i coded to come up when the file extension is invalid. 

If your current code is related to the upload code you have posted on the forum previously, the code that is testing the ['type'] element of the $_FILES array is not testing the file extension, it is testing the mime type that the browser supplies and someone previously stated in this thread why you might get different values from different browsers for the same file.

 

You would both need to display the value you are receiving as part of the error message and add it as one of the permitted types.

I read up on it got it sorted by extenend the possible correct values...

insead of this

 if  ((($_FILES["file"]["type"] == "image/jpeg")[code=php:0] /// just having one possible extention
to ....
[code=php:0]if  ((($_FILES["file"]["type"] == "image/jpeg")
||($_FILES["file"]["type"] == "image/jpg")
||($_FILES["file"]["type"] == "image/png")
||($_FILES["file"]["type"] == "image/x_png")
||($_FILES["file"]["type"] == "image/pjpeg")))

[/code]

 

works like a charm now, thanks for help much appreciated.

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.