for the past few days I\'ve been trying to implement Dropzone into my form, but so far I had no luck figuring out how to make it upload and process the images only when the
<script>
$(document).ready(function () {
Dropzone.options.dropzoneForm = {
autoProcessQueue: false
};
});
function processEvent() { // call this to trigger the upload
$('#dropzoneForm').get(0).dropzone.processQueue();
}
</script>
<form action="/your-post-url-here" method="post" enctype="multipart/form-data" class="dropzone" id="dropzoneForm"></form>
You can supply your own url to upload the file. Currently I am just setting it as 'someurl'
Dropzone.autoDiscover = false;
jQuery(document).ready(function() {
var myDropzone = new Dropzone("#myId", {
url: 'someurl',
autoProcessQueue:false
});
$('#add').on('click',function(e){
e.preventDefault();
myDropzone.processQueue();
});
});