cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

International characters in filenames

International characters in filenames

Artem K.
New member | Level 1

Hi,

I am migrating to V2 of REST API and I am having problems with endpoints that require passing arguments using "Dropbox-API-Arg" header (for example, https://content.dropboxapi.com/2/files/download).

The problem is I am not being able to pass filenames containing international characters.

For example, I have a file "моя запись.txt" saved in my folder, with path "/моя запись.txt"

When I try to simply pass this string in the header, I get an error from ajax:

SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '{"path":"/моя запись.txt"}' is not a valid HTTP header field value.

In V1 of API I simply encoded every path using encodeURIComponent function. In that case the path "/моя запись.txt" would become "%2F%D0%BC%D0%BE%D1%8F%20%D0%B7%D0%B0%D0%BF%D0%B8%D1%81%D1%8C.txt" and that worked for V1.

However, when I try the same with the V2, I get the following error from API:

Error in call to API function "files/download": HTTP header "Dropbox-API-Arg": path: '%2F%D0%BC%D0%BE%D1%8F%20%D0%B7%D0%B0%D0%BF%D0%B8%D1%81%D1%8C.txt' did not match pattern...

I tried to bypass this validation by keeping the slash and encoding only the file name itself. In this case the filepath becomes "/%D0%BC%D0%BE%D1%8F%20%D0%B7%D0%B0%D0%BF%D0%B8%D1%81%D1%8C.txt". This seems to be recognized as a valid path, but I get a new error:

"path/not_found/"

How do I correctly pass that path "/моя запись.txt" to the API endpoint?

Thank you,

Artem

10 Replies 10

Greg-DB
Dropbox Staff
It looks like you opened a new thread for this, so we'll follow up there:

https://www.dropboxforum.com/t5/API-support/HTTP-API-Path-contain-Chinese-response-409-path-not-foun...
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    jianwen Explorer | Level 3
What do Dropbox user levels mean?