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: 

Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)

Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)

Ranjodh S.
New member | Level 1

We are using Dropbox API with Oauth 2.0 to download a file, Its giving us the Error 4xx page. The name of the file is 'DX Haley'. It happens only when the second word in the file name start with letter 'H'. Works fine with other files but as soon as we change file names second word to H it stops working.
For eg. the same file with name 'DX 13.doc' will get downloaded but if its renamed as 'DX Haley.doc' the files doesn't return the file jason instead it returns an HTML page for Error 4xx
Line of Error : OAuthClientRequest requestO = new OAuthBearerClientRequest(GetProperties.getDropBoxMedURI()+fileName).setAccessToken(token).buildQueryMessage();
If fileName = Test test > works
fileName = Test hest > doesn't work

10 Replies 10

Steve M.
Dropbox Staff

To clarify what Greg said, a space is not an allowed character in a URL. If your code is sending URLs with unescaped spaces in them, then you have a bug, which I'd strongly encourage you to fully fix. If all you did was special-case this one character (a space), you're quite likely to run into more issues when you have URLs with other disallowed characters like question marks, hash signs, parentheses, etc. It's true that some services (including ours) will try to guess at the meaning of the invalid URL you're sending, but relying on this seems like a bad idea.

See RFC 2396 for the details on how URLs needs to be escaped, but also consider just using the java.net.URI class, which I believe will handle all the escaping for you.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropbox Staff
  • User avatar
    Ranjodh S. New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Denys P. New member | Level 1
What do Dropbox user levels mean?