doujiaci7976 2012-02-27 17:22
浏览 26
已采纳

PHP中的多文件上传

I have been developing an upload site for a couple of months now, and the most requested feature on the site has been for a Multiple File Uploader, personally, I am more than happy to bring this feature in however I am looking for already-available scripts that will allow me to do this, as I have no idea how to code a purely php/html upload tool.

I came across SWFUpload, this seems like a decent script however I wanted to see if it could do the following:

-> Allow me to select what file extensions are allowed to be upload. -> Allow me to set the maximum amount of files being uploaded. -> Allow me to perform MySQL Queries post upload, as we log all uploads and assign them to accounts

I will need a lot of flexibility in such script, and SWFUpload does not seem to offer such flexibility to change the script into something I want, so I am asking if it would simply be easier to convert what currently is a single file uploader to a multi-file uploader.

Thank you for your time, Jake

  • 写回答

4条回答 默认 最新

  • dongwen9975 2012-02-27 17:29
    关注

    If you are happy to make somethnig for modern browsers only you can simply make your form look like:

    <input name="files[]" type="file" multiple="multiple" />
    

    And your browser will automatically do the rest for the front end.

    If you already can upload files it wont take many changes to upload multiple files, just do what your doing now but in a loop. print_r($_FILES) will show you the structure.

    If you want a fancy front end I recommend Uploadify, it works really well with jQuery.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解
  • ¥15 有偿请教计算电磁学的问题涉及到空间中时域UTD和FDTD算法结合的
  • ¥15 three.js添加后处理以后模型锯齿化严重