Uploading multiple photos in a form
I have a photo-upload form that allows a user to upload 1 photo. But my users are complaining that they want to upload many photos. How can I allow them t开发者_JS百科o do that?
Right now I have this form for uploading: http://www.hikingsanfrancisco.com/account/upload_hike_photos.php?hike_id=58
(I tried to paste code, but it didn't work somehow)
Any thoughts how to best go about it? Is there a way to loop through the selected files maybe? (I am using PHP)
Thanks, Alex
Add more fields for uploading files, I don't know, maybe file or six, and the upload button will check through php which of them have information to start the upload, 1 at a time or course, in a php loop.
Here is a plugin that uses flash + javascript (MooTools) to do file upload. The upside to this plugin is that it's supported and you can Github it. It can have multiple photo uploads, limit max size, etc, and verify file information before upload. Also, has example for backend using PHP on how files are handled after it is uploaded.
Fancyupload
Features
- Select and upload multiple files
- Filter files by type in the select
- dialog A lot of possible Events to add your own behaviour
- Show and filter useful file information before the upload starts
- Limit uploads by file count, type or size
- Platform and server independent, just needs Flash9+ (> 95% penetration) which works on all browsers with it installed
Here is the jQuery plugin that does the same as the MooTools one:
Uploadify
Add new file inputs. Or use smth like swfuploader for file uploading.
精彩评论