How to select multiple files for upload?

2020-01-29 06:50发布

How to select multiple files for upload : enter image description here

9条回答
冷血范
2楼-- · 2020-01-29 07:27
  1. PHP is the back-end, PHP is not the thing which restricts you to use only "one" upload a time
  2. HTML/JavaScript are the front/mid-end which cause the restrictions. (So add HTML to your questions tags)
  3. If you use Flash (AS = ActionScript) you can still have PHP as back-end, as processor which handles the uploaded files.
查看更多
Ridiculous、
3楼-- · 2020-01-29 07:31

There is no html/javascript workaround. You would have to look to flash or java to be able to do this.

查看更多
疯言疯语
4楼-- · 2020-01-29 07:36

In HTML5 you can set the multiple attribute on <input type="file">. This works in browsers supporting HTML5.

<input type="file" name="upload" multiple="multiple" />

In HTML4 your best bet is Flash or Java Applet. There are 3rd party libs available like Uploadify, SWFupload, JUpload and JumpLoader.

查看更多
成全新的幸福
5楼-- · 2020-01-29 07:40

I would definately at this point go with new HTML5 "multiple" attribute:

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

The only viable alternative is FLASH plugins like swfupload.

However - there are multiple prublems with using FLASH for uploads, the main one foor me would be cookie bug:

FLASH plugins don't send cookies correctly. Each browser has it's own cookie storage.FLASH always sends cookies from IE even if you use Google Chrome for example. - result is that you loose cookies and sessions. there is a workaround - but it requires you to send session ID as GET or POST parameters which in turn makes your site vulnerable for session fixation.

查看更多
戒情不戒烟
6楼-- · 2020-01-29 07:42

As others have said, you have to use Flash to get multiple uploads. An alternative to uploadify is SWFUpload.

查看更多
迷人小祖宗
7楼-- · 2020-01-29 07:44

You could also use javascript plugins such as: http://code.google.com/p/noswfupload/

查看更多
登录 后发表回答