JJBlaha Posted December 5, 2006 Share Posted December 5, 2006 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? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 5, 2006 Share Posted December 5, 2006 This line[code]copy ($_FILES['imagefile']['tmp_name'], "images/userimages/".$_FILES['imagefile']['name'])[/code]should be:[code](move_uploaded_file($_FILES['imagefile']['tmp_name'], "images/userimages/".$_FILES['imagefile']['name']))[/code]Try it now. Quote Link to comment Share on other sites More sharing options...
Destruction Posted December 5, 2006 Share Posted December 5, 2006 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 Link to comment Share on other sites More sharing options...
JJBlaha Posted December 5, 2006 Author Share Posted December 5, 2006 nope didint work :( Quote Link to comment Share on other sites More sharing options...
JJBlaha Posted December 5, 2006 Author Share Posted December 5, 2006 [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 :) Quote Link to comment 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.