<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39067#M1220</link>
    <description>&lt;P&gt;We've done some additional investigation on this, and to summarize:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Your respective apps/libraries are apparently not properly escaping the URI path, which results in&amp;nbsp;technically invalid HTTP requests. (That is, they contain unescaped spaces in the URI.)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;&amp;nbsp;Our web server is somewhat forgiving of these malformed requests&amp;nbsp;normally and is able to service the request, except when the unescaped space is followed by an "H", as that causes a different behavior in the web server's HTTP request parser.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The solution is to make sure your app always properly encodes the path in the URI. (This applies to more than just spaces.)&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 06 Aug 2015 00:18:33 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-08-06T00:18:33Z</dc:date>
    <item>
      <title>Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39059#M1212</link>
      <description>&lt;P&gt;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.&lt;BR /&gt;
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&lt;BR /&gt;
Line of Error : OAuthClientRequest requestO = new OAuthBearerClientRequest(GetProperties.getDropBoxMedURI()+fileName).setAccessToken(token).buildQueryMessage();&lt;BR /&gt;
If fileName = Test test &amp;gt; works&lt;BR /&gt;
fileName = Test hest &amp;gt; doesn't work&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:43:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39059#M1212</guid>
      <dc:creator>Ranjodh S.</dc:creator>
      <dc:date>2019-05-29T09:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39060#M1213</link>
      <description>&lt;P&gt;Moved to the API forum.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:39:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39060#M1213</guid>
      <dc:creator>Rich</dc:creator>
      <dc:date>2015-04-02T22:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39061#M1214</link>
      <description>&lt;P&gt;I can't reproduce this error. Here's what happens when I try it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ http get "https://api.dropbox.com/1/metadata/auto/Test test.txt" 'Authorization:Bearer &amp;lt;REDACTED&amp;gt;'
HTTP/1.1 200 OK
...
{"read_only": false, "revision": 47485, "bytes": 4, "thumb_exists": false, "rev": "b97d10f8d89e", "modified": "Thu, 02 Apr 2015 15:43:00 +0000", "mime_type": "text/plain", "size": "4 bytes", "path": "/Test test.txt", "is_dir": false, "modifier": null, "root": "dropbox", "client_mtime": "Thu, 02 Apr 2015 15:43:00 +0000", "icon": "page_white_text"}

$ http get "https://api.dropbox.com/1/metadata/auto/Test hest.txt" 'Authorization:Bearer &amp;lt;REDACTED&amp;gt;'
HTTP/1.1 200 OK
...
{"read_only": false, "revision": 47486, "bytes": 4, "thumb_exists": false, "rev": "b97e10f8d89e", "modified": "Thu, 02 Apr 2015 15:43:03 +0000", "mime_type": "text/plain", "size": "4 bytes", "path": "/Test hest.txt", "is_dir": false, "modifier": null, "root": "dropbox", "client_mtime": "Thu, 02 Apr 2015 15:43:03 +0000", "icon": "page_white_text"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you share some more information?&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;What programming language are you using?&lt;/LI&gt;
&lt;LI&gt;Are you using an OAuth or Dropbox library? If so, which one?&lt;/LI&gt;
&lt;LI&gt;What does &lt;CODE&gt;GetProperties.getDropBoxMedURI()&lt;/CODE&gt; return?&lt;/LI&gt;
&lt;LI&gt;What's the exact value of &lt;CODE&gt;fileName&lt;/CODE&gt; (both in the successful and unsuccessful calls)?&lt;/LI&gt;
&lt;LI&gt;What is the code for &lt;CODE&gt;OAuthBearerClientRequest&lt;/CODE&gt;, including its &lt;CODE&gt;buildQueryMessage&lt;/CODE&gt; method? (Perhaps that's from a library?)&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:49:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39061#M1214</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-04-02T22:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39062#M1215</link>
      <description>&lt;P&gt;I've got same issue.&lt;/P&gt;

&lt;P&gt;Just one thing: 'H' letter must be upper case in second word:&lt;/P&gt;

&lt;P&gt;If fileName = Test Test &amp;gt; works&lt;/P&gt;

&lt;P&gt;fileName = Test Hest &amp;gt; doesn't work&lt;/P&gt;

&lt;P&gt;The Android library works fine and the direct request using CURL does not. The answer from server is the page with 4xx error.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;My info:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;C++&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Custom implementation based on CURL&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;not implemented in our library&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;In my case: Van Halen.mp3 - not successful, Alice Cooper.mp3 - successful&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Not sure that understand what this mean&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 04 Aug 2015 22:10:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39062#M1215</guid>
      <dc:creator>Denys P.</dc:creator>
      <dc:date>2015-08-04T22:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39063#M1216</link>
      <description>&lt;P&gt;Hi Steve&lt;/P&gt;

&lt;P&gt;Apologies for late reply, somehow I missed the mail from this thread.&lt;/P&gt;

&lt;P&gt;Please find the inline comments&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;What programming language are you using? -- Java&lt;/LI&gt;
&lt;LI&gt;Are you using an OAuth or Dropbox library? If so, which one? -- Oauth library(Apache Oltu)&lt;/LI&gt;
&lt;LI&gt;What does &lt;CODE&gt;GetProperties.getDropBoxMedURI()&lt;/CODE&gt; return? (It returns url - &lt;A href="https://api.dropbox.com/1/media/auto/" rel="nofollow noreferrer"&gt;https://api.dropbox.com/1/media/auto/&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;What's the exact value of &lt;CODE&gt;fileName&lt;/CODE&gt; (both in the successful and unsuccessful calls)? (Filename is already given Second word must&amp;nbsp;start with 'H' try capital letter as mentioned in the above comment)&lt;/LI&gt;
&lt;LI&gt;What is the code for &lt;CODE&gt;OAuthBearerClientRequest&lt;/CODE&gt; , including its &lt;CODE&gt;buildQueryMessage&lt;/CODE&gt; method? (Perhaps that's from a library?) (same apache oltu)&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Please let me know in case you need more information.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 22:39:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39063#M1216</guid>
      <dc:creator>Ranjodh S.</dc:creator>
      <dc:date>2015-08-04T22:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39064#M1217</link>
      <description>&lt;P&gt;Ranjodh,&amp;nbsp;can you share the code that actually makes the request? It looks like that library just returns a URL to you, and I suspect there's an error in the code that escapes the URL and makes the HTTP request. Maybe you can share&amp;nbsp;the relevant part of your code?&lt;/P&gt;

&lt;P&gt;Denys,&amp;nbsp;similarly, you'll need to share the code you're using to make the request. (Are you using OAuth 1? HMAC signing or PLAINTEXT? Or OAuth 2?)&lt;/P&gt;

&lt;P&gt;In both cases, I suspect a URL escaping error, but it's likely that the exact source is different, since you're writing code in different languages and with different libraries.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 07:36:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39064#M1217</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-08-05T07:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39065#M1218</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;We are using** OAuth2 &amp;nbsp; **&lt;/P&gt;

&lt;P&gt;Sorry, I cannot share code. The main strange thing is that we can get metadata from any file except when " H" is in the code. At the moment we fixed this behavior by changing all spaces to %20&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 13:04:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39065#M1218</guid>
      <dc:creator>Denys P.</dc:creator>
      <dc:date>2015-08-05T13:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39066#M1219</link>
      <description>&lt;P&gt;Hi Steve&lt;/P&gt;

&lt;P&gt;Sorry, we also cannot share the code. We have also handled it by using '%20' as space. Did you try with capital 'H' as mentioned by Denys. Rename file to "Text Hest" and then try. It will reproduce the issue hopefully. I will try to put a sample code on github if got enough time as currently I am bit busy.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 13:37:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39066#M1219</guid>
      <dc:creator>Ranjodh S.</dc:creator>
      <dc:date>2015-08-05T13:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39067#M1220</link>
      <description>&lt;P&gt;We've done some additional investigation on this, and to summarize:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Your respective apps/libraries are apparently not properly escaping the URI path, which results in&amp;nbsp;technically invalid HTTP requests. (That is, they contain unescaped spaces in the URI.)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;&amp;nbsp;Our web server is somewhat forgiving of these malformed requests&amp;nbsp;normally and is able to service the request, except when the unescaped space is followed by an "H", as that causes a different behavior in the web server's HTTP request parser.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The solution is to make sure your app always properly encodes the path in the URI. (This applies to more than just spaces.)&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 06 Aug 2015 00:18:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39067#M1220</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-08-06T00:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39068#M1221</link>
      <description>&lt;P&gt;Hi Steve&lt;/P&gt;

&lt;P&gt;Thanks for&amp;nbsp;the update, we are using the same library for Google Drive and its working fine, So we are ok with replacing space with '%20' for the time being. Hope you can do something with point 2 mentioned in your comment above.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 14:45:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39068#M1221</guid>
      <dc:creator>Ranjodh S.</dc:creator>
      <dc:date>2015-08-06T14:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error 4xx while downloading a file through API which has second word's intials H for eg. (DX Haley)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39069#M1222</link>
      <description>&lt;P&gt;To clarify what Greg said, a space is not an allowed character in a URL.&amp;nbsp;If your code is sending URLs with unescaped spaces in them, then&amp;nbsp;&lt;STRONG&gt;you have a bug&lt;/STRONG&gt;, 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&amp;nbsp;URLs&amp;nbsp;with other disallowed characters like question marks, hash signs, parentheses,&amp;nbsp;etc. It's true that some&amp;nbsp;services (including ours) will&amp;nbsp;try to guess at the meaning of&amp;nbsp;the invalid URL you're sending, but relying on this seems like a bad idea.&lt;/P&gt;

&lt;P&gt;See &lt;A href="http://www.ietf.org/rfc/rfc2396.txt" rel="nofollow noreferrer"&gt;RFC 2396&lt;/A&gt; for the details on how URLs needs to be escaped, but also consider just using the &lt;A href="http://docs.oracle.com/javase/6/docs/api/java/net/URI.html" rel="nofollow noreferrer"&gt;java.net.URI&lt;/A&gt; class, which I believe will handle all the escaping for you.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2015 00:35:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-4xx-while-downloading-a-file-through-API-which-has-second/m-p/39069#M1222</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-08-07T00:35:03Z</dc:date>
    </item>
  </channel>
</rss>

