jQuery File Uploader JavaScript API: Controlling Drag and Drop
Uploadcare jQuery File Uploader supports Drag and Drop that you can control via JavaScript API.
Checking a browser support
We use a boolean parameter that is set to true
if a browser supports Drag and
Drop and file API.
Uploading files by dropping
You can get file objects after dropping them on the el
element, where el
can
be a DOM element, selector or jQuery object.
For instance, that is the way to upload a single file. If multiple files are selected, only the first one of them gets uploaded:
You can also upload multiple files at once. Here is how:
settings
here is a settings object.
Getting raw data by dropping
Our JavaScript API allows you to get raw data after dropping files on the el
element, which can either be a DOM element, selector or jQuery object.
For example: