easyDD is a library to get HTML5 powered dropzones the easy way.
This library provides a easy drop zone without losing control of the data., (*1)
Like to see the demo live? http://msphn.github.io/easydd/, (*2)
It's easy, just include src/easydd.js and easydd.css in your HTML., (*3)
Create an empty div and give it an id., (*4)
Initialize is like that:, (*5)
// Initialize easyDD var dd = new easydd({ // HTML ID of an existing div to render to elementId: 'dd', // Centered text inside the div? text: 'Drop or Click here!', // Max file size in kb maxSize: 250, // Array of allowed mimetypes allowedMimeTypes: ['image/png', 'image/jpeg', 'image/gif'], // Callback function see callbackTest above callback: callbackTest });
And to use all these awesome data you receive, add a callback function in the callback parameter., (*6)
If you don't like limits, just remove maxSize and allowedMimeTypes, every file will be passed now to your callback function., (*7)
npm i easydd
, (*8)
I verified: * Firefox 37+ * Chrome 42+ * Midori 0.5.9 (Apple WebKit) * Internet Explorer 11 (11.0.9600.17728) * Safari 9+, (*9)
Haven't tested with any other browser yet., (*10)
Please support that library by testing and improving., (*11)