以表单上传多张照片
我有一个照片上传表单,允许用户上传 1 张照片。但我的用户抱怨他们想要上传很多照片。我怎样才能允许他们这么做呢?
现在我有这个表格可供上传: http://www.hikingsanfrancisco.com/account/upload_hike_photos.php?hike_id=58
(我尝试粘贴代码,但不知何故它不起作用)
有什么想法如何最好地解决它?有没有办法循环遍历选定的文件? (我正在使用 PHP)
谢谢, 亚历克斯
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 to 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
添加更多用于上传文件的字段,我不知道,也许是文件或六个,上传按钮将通过 php 检查其中哪些字段具有开始上传的信息,一次 1 个或当然,在 php 循环中。
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.
这是一个使用flash + javascript(MooTools)进行文件上传的插件。该插件的优点是它受支持,您可以 Github 它。它可以上传多张照片,限制最大大小等,并在上传之前验证文件信息。另外,还有使用 PHP 的后端示例,说明文件上传后如何处理。
Fancyupload
功能
添加您自己的行为
上传开始
这是 jQuery 插件,其功能与 MooTools 插件相同:
< a href="http://www.uploadify.com/documentation/" rel="nofollow">Uploadify
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
add your own behaviour
the upload starts
Here is the jQuery plugin that does the same as the MooTools one:
Uploadify
添加新的文件输入。或者使用 swfuploader 之类的文件上传。
Add new file inputs. Or use smth like swfuploader for file uploading.