gpt4 book ai didi

javascript - 如何在上传前从 fineuploader 中删除一些文件

转载 作者:行者123 更新时间:2023-11-29 19:39:56 26 4
gpt4 key购买 nike

<分区>

我使用 Fine Uploader 上传多个文件,效果很好。现在我在提交事件中运行了一些 MD5 检查,所以我可以确定文件是否已经上传,但我不知道如何在手动触发上传之前从上传查询或 storedFiles 中删除这些文件.这是我的代码:

<script type="text/javascript">
$("#uploader").fineUploader({
request: {
endpoint: 'home/upload'
},
multiple: true,
autoUpload: false,
editFilename: {
enable: true
}
}).on({
"complete": function (event, id, fileName, responseJSON) {
if (responseJSON.success) {
alert("upload success");
}
},

"submit": function (event,id, fileName) {
var f=$(this).fineUploader('getFile',id);
var xxxx = CheckMD5(f, id);
if (xxxx==false) { //i want ignore the file if checkMD5 return false
$(this).fineUploader.cancle(id) //this is not working

}


},

"error": function (event, id, fileName, reason) {
//alert(reason);
}
});


$("#uploadButton").click(function () {
$('#uploader').fineUploader('uploadStoredFiles');
});
function CheckMD5(f,id) { //i'm using spark-md5.js get to get md5 value and compare in server side
return false; //this is for test
}
</script>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com