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? Link to comment https://forums.phpfreaks.com/topic/29582-image-upload-problem-in-ie-but-not-ff/ 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. Link to comment https://forums.phpfreaks.com/topic/29582-image-upload-problem-in-ie-but-not-ff/#findComment-135728 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 Link to comment https://forums.phpfreaks.com/topic/29582-image-upload-problem-in-ie-but-not-ff/#findComment-135729 Share on other sites More sharing options...
JJBlaha Posted December 5, 2006 Author Share Posted December 5, 2006 nope didint work :( Link to comment https://forums.phpfreaks.com/topic/29582-image-upload-problem-in-ie-but-not-ff/#findComment-135731 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 :) Link to comment https://forums.phpfreaks.com/topic/29582-image-upload-problem-in-ie-but-not-ff/#findComment-135734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.