Did you set paramName correctly? And you need to remember that Dropzone will add [] to this field if uploadMultiple is true, so you can get the values through an array named by your paramName.
But if you want to rename anyway you could try this:
Dropzone.options.myAwesomeForm = {
paramName: "file",
uploadMultiple: true,
parallelUploads: 1,
//[more configuration]
init: function() {
var myDropzone = this;
//[some code]
this.on("sending", function(file, xhr, formData) {
var name = "name-you-want-and-should-be-unique";
formData.append(name, file);
});
//[some more code]
}
}
Note that I set parallelUploads to 1 so the name you want won't be replaced. But if you do want more you should put an data-id to every file you add through listening to event "addedfile" and then take it when you send the file through "sending".
I hope you find it useful :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…