Take Your Search Game to the Next Level with Dropbox Dash  🚀✨ Curious how it works? Ask us here! 

Forum Discussion

knoppys's avatar
knoppys
Explorer | Level 3
3 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

    • knoppys's avatar
      knoppys
      Explorer | Level 3

      Hi

      Thanks for your comment.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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 "&"?