You just need to configure your dropzone accordingly.
Using the sending event you could do something like this:
Dropzone.options.myAwesomeDropzone = {
// Some default configurations
paramName: "file", // The name that will be used to transfer the file
maxFilesize: 2, // MB
// Additional configurations needed for your ajax call
url: "insertyoururlhere",
init: function () {
this.on("error", function (error, message) {
//do something to handle the error
});
this.on("success", function (success, response) {
//do something
});
this.on("sending", function (file, xhr, formData) {
//add any form data that you would have in your ajax function eg:
//formData.append("id", 123);
});
this.on("complete", function () {
this.removeAllFiles(true);
//do something
});
}
});
See this, this and this answer which might also help.