Jump to content

Image upload problem in IE but not FF


JJBlaha

Recommended Posts

This script works perfectly in Firefox, but outputs

Could Not Copy, Wrong Filetype (imagename)

in Internet Explorer

[code]
if(!empty($imagefile)) {
if ($_FILES['imagefile']['type'] == "image/gif" || $_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg" ){

copy ($_FILES['imagefile']['tmp_name'], "images/userimages/".$_FILES['imagefile']['name'])
or die ("Could not copy");
     
echo "";
echo "Name: ".$_FILES['imagefile']['name']."";
echo "Size: ".$_FILES['imagefile']['size']."";
echo "Type: ".$_FILES['imagefile']['type']."";
echo "Copy Done....";
} else {
echo "";
echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")";
}
}
[/code]

Any idea why?
Link to comment
Share on other sites

[quote author=Destruction link=topic=117485.msg479333#msg479333 date=1165356585]
IE can set image/jpeg as image/pjpeg so you'll need to add that to the allowed list.  This is noted in the php.net manual documentation.

Hope this helps,

Dest
[/quote]

worked perfectly thanks :)
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.