note 79472 added to features.fileupload.multiple

From: Date: Thu, 29 Nov 2007 06:47:39 +0000
Subject: note 79472 added to features.fileupload.multiple
Groups: php.notes 
Request: Send a blank email to php-notes+get-132650@lists.php.net to get a copy of this message
<form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a files to upload: <br> <input name="uploadedfile[]" type="file" /><br /> <input name="uploadedfile[]" type="file" /><br /> <input name="uploadedfile[]" type="file" /><br /> <input name="uploadedfile[]" type="file" /><br /> <input name="uploadedfile[]" type="file" /><br /> <input type="submit" value="Upload Files" /> </form> <?php // Where the file is going to be placed (uploader.php) $target_path = "uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ for ($x=0;$x<6 ; $x++){ if (strlen($_FILES['uploadedfile']['name'][$x])>0){ $target_path = $target_path . basename( $_FILES['uploadedfile']['name'][$x]); $_FILES['uploadedfile']['tmp_name'][$x]; $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name'][$x]); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$x], $target_path)) { echo "<br>The file ". basename( $_FILES['uploadedfile']['name'][$x]). " has been uploaded"; } else{ echo "<br>There was an error uploading the file, please try again!"; }}} ?> ---- Server IP: 217.20.138.73 Probable Submitter: 217.65.117.86 ---- Manual Page -- http://www.php.net/manual/en/features.fileupload.multiple.php Edit -- https://master.php.net/note/edit/79472 Del: integrated -- https://master.php.net/note/delete/79472/integrated Del: useless -- https://master.php.net/note/delete/79472/useless Del: bad code -- https://master.php.net/note/delete/79472/bad+code Del: spam -- https://master.php.net/note/delete/79472/spam Del: non-english -- https://master.php.net/note/delete/79472/non-english Del: in docs -- https://master.php.net/note/delete/79472/in+docs Del: other reasons-- https://master.php.net/note/delete/79472 Reject -- https://master.php.net/note/reject/79472 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132650) next »