Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Dropzone is a JavaScript library that turns any HTML element into a dropzone. This means that a user can drag and drop a file onto it, and Dropzone will display file previews and upload progress, and handle the upload for you via XHR.
It's fully configurable, can be styled according to your needs and is trusted by thousands.
Install:
$ npm install dropzone
# or with pnpm:
$ pnpm add dropzoneUse as ES6 module (recommended):
import { Dropzone } from "dropzone";
const dropzone = new Dropzone("div#myId", { url: "/file/post" });or use as CommonJS module:
const { Dropzone } = require("dropzone");
const dropzone = new Dropzone("div#myId", { url: "/file/post" });👉 Checkout our example implementations for different bundlers
Use the standalone files like this:
<script src="https://unpkg.com/dropzone@6/dist/dropzone-min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/dropzone@6/dist/dropzone.css" type="text/css" />
<script>
// Dropzone has been added as a global variable.
const dropzone = new Dropzone("div.my-dropzone", { url: "/file/post" });
</script>src/options.js
for all available options⚠️ NOTE: Dropzone 6 does not support Internet Explorer. If you still need it, use
5.9.3. See theCHANGELOGfor everything that changed in 6.0.0.
If you need support please use the discussions section or
stackoverflow with the dropzone.js tag and not the GitHub issues
tracker. Only post an issue here if you think you discovered a bug.
If you have a feature request or want to discuss something, please use the discussions as well.
⚠️ Please read the contributing guidelines before you start working on Dropzone!
thumbnail(file, data)
and display the image wherever you likeSee the LICENSE file
Dropzone: How to upload video to S3 using presigned URL and play it in browser? Almost works, but not quite.
Documentation: Dead external links
maxFilesize in configuration options doc has bad info
acceptedFiles doesn't work (validate) ignoring
Heic format conversion via heic2any
Can't access dataURL
Orientation fix vs Image Exif
bug: Documentation says maxFilesize is bytes but source code says MBs.
GIF files are converted to png
HTML comment in previewTemplate causes crash