Re: multiple file upload

From: Date: Thu, 14 Nov 2002 15:23:24 +0000
Subject: Re: multiple file upload
Groups: php.general 
Request: Send a blank email to php-general+get-124434@lists.php.net to get a copy of this message
Is it posible to do multiple file upload without selecting each file manual in multiple form fields?
Yes. I have recently implemented an upload mechanism based on hotmails add attachment mechanism. haven't got time for a detailed explanation but here is the basic idea - on your html page - // a file selector field <input type="file" name="userfile" tabindex="1" class="text"> // add remove files buttons <input type="submit" name="addFile" value=" Add " class="text" tabindex="2"> <input type="submit" name="delFile" value="Remove" class="text" tabindex="3"> // files in the upload list field <select name="selectedFileList[]" size=5 multiple tabindex="4" class="text"> <?php $FooObj->displayFileUploadList(); ?> </select> file upload list is a database varchar field with each file id seperated with a pipe character - fileID1|fileID2 add / remove event handlers write / remove entries from this list. displayFileUploadList writes <option> tags for each file in the list finally a doUpload function retrieves the file upload list and copies the files from the upload staging area to their final destination. Incidentally the same mechanism works for lots of other stuff like sending email to multiple recipients etc. Have Fun, javier _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

« previous php.general (#124434) next »