Skip to content

Instantly share code, notes, and snippets.

@tuckbloor
Created June 30, 2016 14:04
Show Gist options
  • Select an option

  • Save tuckbloor/4ae82fe48db0137f2f5922fc480664ff to your computer and use it in GitHub Desktop.

Select an option

Save tuckbloor/4ae82fe48db0137f2f5922fc480664ff to your computer and use it in GitHub Desktop.
dopzone
$(function() {
Dropzone.autoDiscover = false;
$("form#dropzone").dropzone({
autoProcessQueue: false,
maxFiles: 1,
init: function () {
var dropzone = this;
$('#uploadSubmit').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
dropzone.processQueue();
});
},
url: "/document-upload",
acceptedFiles: ".pdf, .xls, .xlsx, .jpg, .jpeg, .pjpeg, .doc, .docx, .xlsm, .xltx, .xltm, .msg",
success: function () {
this.removeAllFiles();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment