gpt4 book ai didi

javascript - 上传后触发功能

转载 作者:行者123 更新时间:2023-11-27 23:56:58 24 4
gpt4 key购买 nike

我在 webix 中实现了一个上传按钮。事件 onBeforeFileAdd 将被触发。

on: {
onBeforeFileAdd: function(item){
var type = item.type.toLowerCase(); // deriving file extension
if (type != "csv"){ // checking the format
webix.message("Only csv files are allowed.");
return false;
}
},
onUploadComplete: function(response) {
webix.message("done");
}
}

onUploadCompleteonFileUpload 不起作用。我还放置了 console.log 但似乎这些事件不会被触发。上传网址响应状态代码200。

最佳答案

只有当响应包含如下所示的对象时,onUploadComplete 事件才会触发:

{ status: 'server', sname:'some server name'};

their documentation :

echo "{ status: 'server', sname:'$sname'}";

关于javascript - 上传后触发功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32181754/

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