Drag and Drop File Uploading With jQuery - Image Uploader

File Size: 18.1 KB
Views Total: 32918
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Drag and Drop File Uploading With jQuery - Image Uploader

This is a simple, customizable jQuery image uploader plugin that features drag'n'drop file selection, image preview, predefined image list, and extension/mime/file size validation.

How to use it:

1. Link to jQuery JavaScript library and the Image Uploader's files.

<link href="dist/image-uploader.min.css" rel="stylesheet">
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="dist/image-uploader.min.js"></script>

2. Create a container element for the drag'n'drop file selection area.

<form action="url" enctype="multipart/form-data">
  <div class="input-images"></div>

3. Attach the plugin to the container element and done.


4. Define an array of pre-select images.

let preloaded = [
    {id: 1, src: '1.jpg'},
    {id: 2, src: '2.jpg'},
    {id: 3, src: '3.jpg'},
    // more images here

  preloaded: preloaded

5. Specify the allowed extension, mime type, max files, and max file size.

  extensions: ['.jpg', '.jpeg', '.png', '.gif', '.svg'],
  mimes: ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml'],
  maxSize: undefined,
  maxFiles: undefined,

6. More customization options.

  imagesInputName: 'images',
  preloadedInputName: 'preloaded',
  label: 'Drag & Drop files here or click to browse'


v1.2.3 (2019-11-27)

  • Fixed: In ajax it is posting only newly added images


  • Removed dependency on Material Icons. Added own icon fonts.
  • Fixed bug in upload message when draggable area is empty again.


  • Added max files validation.
  • Removed options 'validateExtension', 'validateMIME' and 'validateMaxSize'
  • Changed default value for 'maxSize'.


  • Added extension, mime and size validations and updated the responsiveness.

This awesome jQuery plugin is developed by christianbayer. For more Advanced Usages, please check the demo page or visit the official website.