Ces derniers jours, le code utilisé pour travailler avec des espaces a commencé à échouer. Je suis en train de me développer, il est donc possible que j'ai raté quelque chose, mais je ne le pense pas. Voici un exemple simple où 5 fichiers se trouvent dans un répertoire Test. Seul le fichier avec un espace ne parvient pas à télécharger. Si je vais sur OneDrive et que je le renommer sans espaces, mon application CloudRail continue sans erreur.API CloudRail - Onedrive ne parvient pas à télécharger le fichier avec des espaces dans le chemin
Merci pour toute aide que vous pouvez fournir!
Charlie Becker
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
Chez CloudRail, nous travaillons actuellement sur un correctif. On dirait que OneDrive a changé sa façon de gérer certaines choses. Je m'attendrais à une libération demain. –