Customer parameter are not going through for file delete

淺唱寂寞╮ 提交于 2019-12-11 15:06:46

问题


I have setup to directly upload image to s3 bucket and I am using fine uploader for that.

I am trying to send filename as parameter (to end point) while deleting a file.

Given below is callback snippet .

onDelete: function(id) {
    $(this).setDeleteFileParams({ filename: this.getName(id) });
}

It is working fine for newly uploaded files, but I already have files through initialList (Option) and when I try to delete them the filename param is not going through.


回答1:


You are not using the jQuery wrapper correctly. This is one of many reasons why I have suggested avoiding jQuery and the jQuery wrapper, as the "vanilla" API is much more intuitive. You've left out some code, but it looks like you are actually declaring your event handler as a property of the callbacks config object, which means you can avoid the jQuery wrapper entirely.

onDelete: function(id) {
    var name = this.getName(id);
    this.setDeleteFileParams({filename: name}, id);
}

But this code is not necessary, as Fine Uploader S3 sends the name of the object in S3 as a "key" parameter with the delete request.



来源:https://stackoverflow.com/questions/31069212/customer-parameter-are-not-going-through-for-file-delete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!