FineUploader submitDelete Get FileName and Extension

三世轮回 提交于 2019-12-01 14:39:47

You can pass whatever parameters you want with the DELETE request. In the submitDelete callback, for example, you can call the setDeleteFileParams API method, passing in the filename. There is a getName API method that will return the name of a file, given the file's ID.

I just noticed that the setDeleteFileParams API method is not documented. I'll open up a bug report and be sure to properly document that in 3.6. This method works just like the setParams API method (same parameters). Please note though, that parameters for DELETE requests will be part of the query string.

Inside your onSubmitDelete callback handler, the following code will retrieve the filename and add it as a parameter for the associated DELETE request:

.on('submitDelete', function(event, id) {
   var filename = $(this).fineUploader('getName', id);
   $(this).fineUploader('setDeleteFileParams', {filename: filename}, id);
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!