For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
GuidesIntegrationsAPI ReferencesRelease notes
GuidesIntegrationsAPI ReferencesRelease notes
  • Introduction
    • Overview
    • Quick Start
    • Projects
    • Billing
  • Uploading
    • Overview
      • Overview
      • Options
        • Overview
        • Widget reference
        • Uploading files
        • File groups
        • File validation
        • Upload dialog and panel
        • Handling custom tabs
        • Controlling drag and drop
        • Widget tabs styling
        • Widget initialization
      • File validation
      • Image editor
      • Security settings
    • Uploading files with API
    • File analysis on upload
  • Optimization
    • Overview
  • Transformations
  • Delivery
    • Overview
    • On-the-fly operations
    • CDN settings
    • Proxy
  • Security
    • Overview
    • Validation and moderation
    • Signed uploads
    • Signed URLs
    • Unsafe content moderation
    • Malware protection
    • HIPAA workflows
  • Storage
    • Uploadcare storage
    • Cloudflare R2
    • Google Cloud Storage
    • Azure Blob Storage
  • File management
    • Overview
    • Managing files
    • File groups
    • Webhooks
    • Arbitrary file metadata
  • CLI
    • Overview
    • Configuration
  • Migration
    • Migration to Uploadcare
    • Migration from Filestack
Dashboard
LogoLogo
On this page
  • Checking a browser support
  • Uploading files by dropping
  • Getting raw data by dropping
UploadingjQuery UploaderWidget API

jQuery File Uploader JS API: Controlling Drag&Drop

Was this page helpful?
Previous

jQuery File Uploader JS API: Styling

Next
Built with
jQuery File Uploader package is officially deprecated as of September 1, 2025.
Moving forward, we will no longer release updates or new versions of this widget.
Support will also be discontinued, except in cases where critical security vulnerabilities need to be addressed.

We recommend considering our web-component-based File Uploader.

Uploadcare jQuery File Uploader supports Drag and Drop that you can control via JavaScript API.

  • Checking browser support
  • Uploading files by dropping
  • Getting raw data by dropping

Checking a browser support

We use a boolean parameter that is set to true if a browser supports Drag and Drop and file API.

1var browser_supports_dragdrop = uploadcare.dragdrop.support;

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.

1uploadcare.dragdrop.uploadDrop(el, callback[, settings]);

For instance, that is the way to upload a single file. If multiple files are selected, only the first one of them gets uploaded:

1uploadcare.dragdrop.uploadDrop(el, function(file) {
2 file.done(...);
3});

You can also upload multiple files at once. Here is how:

1uploadcare.dragdrop.uploadDrop(el, function(files) {
2 files; // array
3}, {multiple: true});

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.

1uploadcare.dragdrop.receiveDrop(el, callback);

For example:

1uploadcare.dragdrop.receiveDrop(el, function(type, data) {
2 type; // 'object' or 'url'
3 data; // Array of native File objects or URLs.
4
5 // Retrieving files, or just the first one if there are many.
6 var file = uploadcare.fileFrom(type, data[0]);
7
8 // Retrieving multiple files in one go
9 var fileArray = uploadcare.filesFrom(type, data);
10});