Facebook-style multiple image upload

2019-04-10 05:28发布

Facebook has the ability to select multiple images in the file browser in its upload feature.

Can anyone explain how this is achieved?

I'd like to do something similar in jquery without the use of a flash widget.

标签: file-upload
3条回答
迷人小祖宗
2楼-- · 2019-04-10 05:33

The HTML5 File API enables you to do it natively. Basically you add the multiple="multiple" attribute to the file upload control:

<input multiple="multiple" type="file" ... />

Disadvantage: Only runs in modern browsers like Firefox, Chrome, Safari. IE, even version 9 does not support this multiple upload.

Otherwise, you have to rely on some Flash or Java upload component.

(Edit: Changed to multiple="multiple", thanks to Ms2ger)

查看更多
We Are One
3楼-- · 2019-04-10 05:42

The best and easiest jQuery-based multiupload scripts (IMHO):

http://www.uploadify.com/
http://www.uploadify.com/demos/

free and open source

查看更多
Juvenile、少年°
4楼-- · 2019-04-10 05:50

Instructions on how to include jQuery File Upload with Rails setup https://github.com/blueimp/jQuery-File-Upload/wiki/Rails-setup-for-V5/35cca0e5e21b5c8fb29b89e9675314907ac1a464

(note: this question was originally answered 3 years ago, the above link may have inaccurate instructions for recent versions of the referred gems/libraries, but may be easy for someone to follow and fix whatever have changed).

查看更多
登录 后发表回答