在过去的几天里,过去使用空格的代码已经开始失败。我积极开发,所以我可能搞砸了,但我不这么认为。下面是一个简单的示例,其中5个文件位于Test目录中。只有具有空格的文件无法下载。如果我去OneDrive并将其重命名为空格,那么我的CloudRail应用程序会继续运行而不会出错。
感谢您提供的任何帮助!
查理贝克尔
app.get("/auth/test/onedrive", (req, res) => {
let service = makeService('onedrive'); // Make the service the user is logged in with
service.loadAsString(authState); // Skip authentication by loading the saved credentials
service.getUserName((err, name) => { // We retrieve the user's full name and save it on signup so it stays constant
console.log('Hello ' + name);
});
service.getChildren("/Pictures/Test", (err, children) => {
if (err) throw err;
for (let child of children) {
console.log('Trying to download FILE: ' + child.path);
service.download(child.path, (err, stream) => {
if (err) throw err + ' FILE: ' + child.path;
console.log('Downloaded FILE: ' + child.path);
});
}
});
});
Making service: "onedrive" Trying to download FILE: /Pictures/Test/dogs out.jpg Trying to download FILE: /Pictures/Test/dogsout.jpg Trying to download FILE: /Pictures/Test/IMAG0039.JPG Trying to download FILE: /Pictures/Test/IMG_2494.JPG Trying to download FILE: /Pictures/Test/whiskey_black.png Unhandled rejection Error: Item does not exist FILE: /Pictures/Test/dogs out.jpg Hello Charlie Becker Downloaded FILE: /Pictures/Test/whiskey_black.png Downloaded FILE: /Pictures/Test/IMG_2494.JPG Downloaded FILE: /Pictures/Test/IMAG0039.JPG Downloaded FILE: /Pictures/Test/dogsout.jpg
答案 0 :(得分:0)