0

In the last few days, code that used to work with spaces has started to fail. I'm actively developing so it's possible I've messed something up, but I don't think so. Below is a simple example where 5 files are in a Test directory. Only the file with a space fails to download. If I go to OneDrive and rename this to no spaces, then my CloudRail app continues without error.

Thanks for any help you can provide!

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
  • We at CloudRail are currently working on a fix. It seems like OneDrive changed sth in the way they handle certain things. I would expect a release tomorrow. – Dr. GIT Mar 30 '17 at 12:58

1 Answers1

0

apparently Microsoft changed what kind of URL-encoding they accept for filenames with spaces in their OneDrive API without prior announcement. The newest version of the CloudRail Node.js SDK (2.17.3) has adapted accordingly and should fix this issue.

Florian
  • 712
  • 5
  • 18