NewUser
NewUser

Reputation: 13323

Dropzone file upload use unique name

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

Answers (2)

Gaurav joshi
Gaurav joshi

Reputation: 1799

I think its paramName Option that you need to use.

Upvotes: 0

Mad Angle
Mad Angle

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

Related Questions