iceblox Posted June 1, 2007 Share Posted June 1, 2007 First off my apologies for cheating.. ;o) But i need a quick turn around on a mulitple upload script. I found on google a pretty decent front end but I need to make my own back end. Which i can do if it was one file being uploaded.. <? if(isset( $Submit )) { if ($_FILES['imagefile']['type'] == "image/gif"){ copy ($_FILES['imagefile']['tmp_name'], "files/".$_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 "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>"; } } >? How would i make this work with any number of uploads? (max 9) Here is the front end script link.... http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/ Thanks in advance Link to comment https://forums.phpfreaks.com/topic/53881-solved-multiple-upload-script-help/ Share on other sites More sharing options...
dough boy Posted June 1, 2007 Share Posted June 1, 2007 Replace the ['imagefile'] with ['imagefile_$x'] and put it into a loop. Link to comment https://forums.phpfreaks.com/topic/53881-solved-multiple-upload-script-help/#findComment-266405 Share on other sites More sharing options...
iceblox Posted June 1, 2007 Author Share Posted June 1, 2007 that sounds easy said that done.. I have never had to loop anything before. How would one go about it? Link to comment https://forums.phpfreaks.com/topic/53881-solved-multiple-upload-script-help/#findComment-266408 Share on other sites More sharing options...
dough boy Posted June 1, 2007 Share Posted June 1, 2007 http://us.php.net/manual/en/control-structures.for.php That should get you going. You could also use while. Link to comment https://forums.phpfreaks.com/topic/53881-solved-multiple-upload-script-help/#findComment-266410 Share on other sites More sharing options...
iceblox Posted June 1, 2007 Author Share Posted June 1, 2007 Wicked thanks Link to comment https://forums.phpfreaks.com/topic/53881-solved-multiple-upload-script-help/#findComment-266412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.