Reputation: 13323
I am using dropzone for file upload. I just love it. But one thing I want that, I want to use the unique name for each file. So that there will be no repeat file names in the dropzone. So any help and suggestions will be really appreciable. Thanks. Any one there for help?
Upvotes: 2
Views: 1602
Reputation: 2330
I think its a better way to use timestamps
with filenames for uniqueness.
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 = new Date().getTime();//or any other name you want to append with the filename
formData.append(name, file);
});
//[some more code]
}
}
Upvotes: 4