darkfreaks Posted February 24, 2008 Share Posted February 24, 2008 sometimes it uploads sometimes it does not anyone see flaws? <?php if(!empty($_FILES['images']'name'][0])) { while(list($key,$value) = each($_FILES['images']['name'])) { if(!empty($value)) { list($fname,$ext) = split("\.", $value); if ($ext == "jpg" || $ext == "gif" || $ext == "png") { $NewImageName = $t."_offer_".$value; copy($_FILES['images']['tmp_name'][$key], "re_images/".$NewImageName); $MyImages[] = $NewImageName; } } } if(!empty($MyImages)) { $ImageStr = implode("|", $MyImages); } }?> Link to comment https://forums.phpfreaks.com/topic/92667-image-function-not-uploading-correctly/ Share on other sites More sharing options...
drisate Posted February 24, 2008 Share Posted February 24, 2008 You could handle your errors so you know why it's not uploading <?php if(!empty($_FILES['images']'name'][0])) { while(list($key,$value) = each($_FILES['images']['name'])) { if(!empty($value)) { list($fname,$ext) = split("\.", $value); if ($ext == "jpg" || $ext == "gif" || $ext == "png") { $NewImageName = $t."_offer_".$value; copy($_FILES['images']['tmp_name'][$key], "re_images/".$NewImageName); $MyImages[] = $NewImageName; }else{ echo "Only jpg, gif and png"; } }else{ echo "Value is empty"; } } if(!empty($MyImages)) { $ImageStr = implode("|", $MyImages); } }else{ echo "File not posted"; }?> Of course if your img has 11 mega px it's not gona upload lol Link to comment https://forums.phpfreaks.com/topic/92667-image-function-not-uploading-correctly/#findComment-474878 Share on other sites More sharing options...
darkfreaks Posted February 24, 2008 Author Share Posted February 24, 2008 that wont work sorry ??? Link to comment https://forums.phpfreaks.com/topic/92667-image-function-not-uploading-correctly/#findComment-474882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.