FineUploader submitDelete Get FileName and Extension

后端 未结 1 522
执念已碎
执念已碎 2021-01-17 03:30

I need to call a Web Service before the file is delete so I decided to use the \"submitDelete\" callback. What I\'m trying to accomplish is to get the Name of the File and

相关标签:
1条回答
  • 2021-01-17 04:15

    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);
    });
    
    0 讨论(0)
提交回复
热议问题