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条)

报告相同问题?