dropzone.js is an open source library that provides drag’n’drop file uploads by simply including a java-script file. It views previews of images and you can register to different events to control how and which files are uploaded.
That’s it. Dropzone will find all form elements with the class dropzone,automatically attach itself to it, and upload files dropped into it to the specified action attribute.
Don’t forget to require dropzone, otherwise it won’t be activated.
Dropzones don’t have to be forms. Any element with a .dropzone class will do, but you have to configure the url if you choose another element (in forms, the action attribute is used as url).
accept is a function that gets a file and a done function as parameter. If the done function is invoked without a parameter, the file will be processed. If you pass an error message it will be displayed and the file will not be uploaded.
previewTemplate is a string that contains the template used for each dropped image. Change it to fulfill your needs but make sure to properly provide all elements.
For all the other browsers, dropzone provides an oldschool file input fallback.
i was going through the tutorial but i cant understand how can i use dropzone without using the class in the form..
i basically want to have a div inside a form and call class=”dropzone in that div..but it dosent seems to work..