Forum Discussion

knoppys's avatar
knoppys
Explorer | Level 3
4 years ago

Dropbox Upload API - Sending special characters in file path

Hi All

 

Im trying to send a file to DB using the upload API using the JS SDK. The upload IS WORKING, however, when the file is folder "Salt and Pepper" is created, its replacing the & symbol that Im sending with &.

 

The file path I am trying to write to is:

/Salt & Pepper/serialnumber-filename.zip

 

However, the file path being written is:

/Salt & Pepper/serialnumber-filename.zip

 

Here is my code?

 

var path = '/Salt & Pepper/'+file.name;
dbx.filesUpload({path: path, contents: file})

 

 Should this be painfully obvious to me? lol

 

EDIT: I answered my own question looking into it. Im actually saving the folderpath on my side using the & and not the & symbol after all. This is totally why its not working. 

Thanks for your help anyway. 

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    knoppys As Здравко mentioned, you're missing a leading slash in the path you're showing here, so this call would fail anyway, and would not upload anything.

     

    If you are successfully uploading something, e.g., with a different version of this code, though, can you clarify where/how you're seeing the unexpected "&"?

  • knoppys's avatar
    knoppys
    Explorer | Level 3
    4 years ago

    Hi

    Thanks for your comment.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!