使用servlet删除FineUploader

时间:2016-05-31 09:57:21

标签: javascript fine-uploader

我对这个话题很新,这是我第一次使用FineUploader。我目前正在使用Servlet处理客户端请求,它对“POST”完全正常,但不适用于删除。我的servlet中的doDelete方法永远不会被调用。我在这里错过了什么吗?

    var manualUploader = new qq.FineUploader({
element : document.getElementById('fine-uploader-manual-trigger'),
                    template : 'qq-template-manual-trigger',
                    request : {
                    endpoint : 'UploadServlet',                                     
                    filenameParam : 'filename',
                    },
                    deleteFile : {
                    enabled : true,                                     
                    endpoint : 'UploadServlet', 
                    method : 'DELETE'           
                    forceConfirm : true,
                    },                      
                    thumbnails : {
                    placeholders : {
                    waitingPath : 'fine-uploader/placeholders/waiting-generic.png',
                    notAvailablePath : 'fine-uploader/placeholders/not_available-generic.png'
                    }
                    },
                autoUpload : false,
                debug : true
                            });

控制台输出:

fine-uploader.js:3961 DELETE http://localhost:8081/test/UploadServlet/0036839e-3f58-466b-a6d3-05b3f66cedda? 403 (Forbidden)
fine-uploader.js:257 [Fine Uploader 5.9.0] DELETE request for 0 has failed -    response code 403 fine-uploader.js:257
fine-uploader.js:257 [Fine Uploader 5.9.0] Delete request for 'file.png' has failed.

1 个答案:

答案 0 :(得分:0)

请尝试使用以下代码删除文件选项。

deleteFile: {
       enabled: true,
       endpoint: "UploadServlet",
       forceConfirm: true,
       params: {
       foo: "bar"
       }
}