akash
akash

Reputation: 173

how to pass uploaded file name server side through delete option using fine Uploader

Here the code I'm using:

deleteFile: {
   enabled: true,
   method: "POST",
   forceConfirm: true,
   params:{
      id: document.getElementById("fine-uploader-gallery")
   },
   endpoint: '/FineUpload/Delete'
},
callbacks: {
   onDelete: function(id) {
      this.setDeleteFileParams({filename: this.getName(id)}, id)
   }
}

Upvotes: 2

Views: 583

Answers (1)

Ray Nicholus
Ray Nicholus

Reputation: 19890

Very close! You should pass new delete file request parameters in an onSubmitDelete callback handler, instead of onDelete. So your callbacks option should look this:

callbacks: {
   onSubmitDelete: function(id) {
      this.setDeleteFileParams({filename: this.getName(id)}, id)
   }
}

I have updated the documentation for onDelete and onSubmitDelete to steer others with this goal in the correct direction.

Upvotes: 2

Related Questions