Skip to content

Instantly share code, notes, and snippets.

@robgcf
Created October 2, 2017 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robgcf/28cff10f52a8fc54d119f6104bbbdb9f to your computer and use it in GitHub Desktop.
Save robgcf/28cff10f52a8fc54d119f6104bbbdb9f to your computer and use it in GitHub Desktop.
// Here's the javscript:
var myDropzone = new Dropzone(".dropzone"); // this causes an error: "dropzone is already attached"
Dropzone.options.myDropzone = {
dictDefaultMessage: "Drop files here or Click to upload",
paramName: "file",
maxFilesize: 5
};
// without the var myDropzone above, this causes an error about myDropzone.on is not a function.
myDropzone.on("success", function(file) {
getUserFiles();
});
// Here's the HTML:
<form action="/whatever" class="dropzone" id="myDropzone">
<input type="hidden" name="userid" value="1">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment