Upload multiple Facebook style images

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

Can anyone explain how this is achieved?

I would like to do something like this in jquery without using a flash widget.

+4
source share
3 answers

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

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

Disadvantage: only works in modern browsers such as Firefox, Chrome, Safari. IE, even version 9 does not support this multiple download.

Otherwise, you must rely on some component of the Flash or Java download.

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

+7
source

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

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

free and open source

0
source

Instructions for enabling 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 link above may have inaccurate instructions for the latest versions of the gems / libraries mentioned, but it can be easy for someone to keep track of and fix everything that has changed).

-1
source

Source: https://habr.com/ru/post/1334845/


All Articles