gpt4 book ai didi

javascript - OneDrive Saver Api(多个文件上传)

转载 作者:行者123 更新时间:2023-12-03 09:29:29 27 4
gpt4 key购买 nike

 var MyFiles = [];
if (val == "Address") {
MyFiles.push({ 'file': 'http://----/Content/File/Addresses.xlsx', 'fileName': 'Addresses.xlsx' });
}
if (val == "DebitDetail") {
MyFiles.push({ 'file': 'http://----/Content/File/DebitDetails.xlsx', 'fileName': 'DebitDetails.xlsx' });
}
if (val == "AddressAssociated") {
MyFiles.push({ 'file': 'http://----/Content/File/AddressAssociatedCompanies.xlsx', 'fileName': 'AddressAssociatedCompanies.xlsx' });
}
if (val == "DebitDetailAssociated") {
MyFiles.push({ 'file': 'http://----/Content/File/DebitDetailsAssociatedCompanies.xlsx', 'fileName': 'DebitDetailsAssociatedCompanies.xlsx' });
}



var saverOptions = {
file: myFiles,
success: function () {
// upload is complete
},
progress: function (p) {
// upload is progressing
},
cancel: function () {
// upload was cancelled
},
error: function (e) {
// an error occured
}
};

OneDrive.save(saverOptions);

我已将上述代码用于 DropBox,它运行良好,因为它需要一个对象数组,但我找不到 OneDrive.com 的解决方案!以下文档仅展示如何使用 URL 上传单个文件。但我想上传多个文件。

来自 OneDrive 网站的格式

var saverOptions = {
file: "inputFile",
fileName: 'file.txt',
success: function(){
// upload is complete
},
progress: function(p) {
// upload is progressing
},
cancel: function(){
// upload was cancelled
},
error: function(e) {
// an error occured
}
}

https://dev.onedrive.com/sdk/javascript-picker-saver.htm

最佳答案

目前,OneDrive Saver 仅允许您一次上传一个文件。根据您正在编写的应用程序类型,可能可以选择直接访问 OneDrive API。以下是有关 uploading files with the API 的信息.

关于javascript - OneDrive Saver Api(多个文件上传),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31561503/

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