You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
wolfgangmeyers
2 years agoHelpful | Level 5
409 error when attempting to download image files
This was working perfectly fine a few days ago when I was testing integration with aibrush.art. Now when my app makes requests for any files ending in .webp or .png, a 409 response is returned with n...
- 2 years ago
Well, it has mysteriously stopped happening since I reported it. Someone must have caught the bug and fixed it 🙂
Greg-DB
2 years agoDropbox Staff
I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:
- the name and version number of the platform and SDK/library you are using, if any
- the steps to reproduce the issue, including relevant code snippet(s)
- the full text of any error or unexpected output, ideally including any/all headers and bodies for both request and response
Please be sure to redact any sensitive values, such as any access tokens or refresh tokens.
- wolfgangmeyers2 years agoHelpful | Level 5
Thanks for the help!
I'm using the "dropbox" npm package version 10.34.0.
Here's a code snippet that shows the `Dropbox` instance being used to download the image file:const imageFileName = `image_filename.png`;const imageResult = (await this.dropbox.filesDownload({path: `/${imageFileName}`,})).result;
For more context, here is a link to the place in my codebase that has the problem: https://github.com/wolfgangmeyers/aibrush-2/blob/main/src/lib/dropbox.ts#L167
Request Headers:POST /2/files/download HTTP/1.1Accept: */*Accept-Encoding: gzip, deflate, brAccept-Language: en,en-US;q=0.9Authorization: Bearer <redacted>Connection: keep-aliveContent-Length: 0Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}Host: content.dropboxapi.comOrigin: http://localhost:3001Referer: http://localhost:3001/Sec-Fetch-Dest: emptySec-Fetch-Mode: corsSec-Fetch-Site: cross-siteUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"sec-ch-ua-mobile: ?0sec-ch-ua-platform: "Linux"
Response Headers:HTTP/1.1 409 ConflictAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: Accept-Ranges, Content-Range, ETag, Dropbox-API-ResultCache-Control: no-cacheContent-Security-Policy: sandbox allow-forms allow-scriptsX-Content-Type-Options: nosniffContent-Type: application/jsonAccept-Encoding: identity,gzipDate: Mon, 31 Jul 2023 16:55:48 GMTServer: envoyContent-Length: 97Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadX-Robots-Tag: noindex, nofollow, noimageindexX-Dropbox-Response-Origin: far_remoteX-Dropbox-Request-Id: 05ee6d257ece4f0e849a94b9d15d4fa3
If I change the file name to end in "_png" instead of ".png" and then download it, I get a 200 response and it downloads fine. Same happens with .webp files. The .json files that I'm using to store image metadata download without any issues. - wolfgangmeyers2 years agoHelpful | Level 5
I just replied with all of the info you requested but my reply disappeared. Did you get the reply or do I need to repost it?
- wolfgangmeyers2 years agoHelpful | Level 5
Request headers:
POST /2/files/download HTTP/1.1Accept: */*Accept-Encoding: gzip, deflate, brAccept-Language: en,en-US;q=0.9Authorization: Bearer <redacted>Connection: keep-aliveContent-Length: 0Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}Host: content.dropboxapi.comOrigin: http://localhost:3001Referer: http://localhost:3001/Sec-Fetch-Dest: emptySec-Fetch-Mode: corsSec-Fetch-Site: cross-siteUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"sec-ch-ua-mobile: ?0sec-ch-ua-platform: "Linux" - wolfgangmeyers2 years agoHelpful | Level 5
Response Headers:
HTTP/1.1 409 ConflictAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: Accept-Ranges, Content-Range, ETag, Dropbox-API-ResultCache-Control: no-cacheContent-Security-Policy: sandbox allow-forms allow-scriptsX-Content-Type-Options: nosniffContent-Type: application/jsonAccept-Encoding: identity,gzipDate: Mon, 31 Jul 2023 16:55:48 GMTServer: envoyContent-Length: 97Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadX-Robots-Tag: noindex, nofollow, noimageindexX-Dropbox-Response-Origin: far_remoteX-Dropbox-Request-Id: 05ee6d257ece4f0e849a94b9d15d4fa3 - wolfgangmeyers2 years agoHelpful | Level 5
Request Headers:
POST /2/files/download HTTP/1.1Accept: */*Accept-Encoding: gzip, deflate, brAccept-Language: en,en-US;q=0.9Authorization: Bearer ...Connection: keep-aliveContent-Length: 0Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}Host: content.dropboxapi.comOrigin: http://localhost:3001Referer: http://localhost:3001/Sec-Fetch-Dest: emptySec-Fetch-Mode: corsSec-Fetch-Site: cross-siteUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"sec-ch-ua-mobile: ?0sec-ch-ua-platform: "Linux" - wolfgangmeyers2 years agoHelpful | Level 5Request headers:
POST /2/files/download HTTP/1.1Accept: */*Accept-Encoding: gzip, deflate, brAccept-Language: en,en-US;q=0.9Connection: keep-aliveContent-Length: 0Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}Host: content.dropboxapi.comOrigin: http://localhost:3001Referer: http://localhost:3001/Sec-Fetch-Dest: emptySec-Fetch-Mode: corsSec-Fetch-Site: cross-siteUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"sec-ch-ua-mobile: ?0sec-ch-ua-platform: "Linux" - wolfgangmeyers2 years agoHelpful | Level 5
Here is where my problem occurs: https://github.com/wolfgangmeyers/aibrush-2/blob/main/src/lib/dropbox.ts#L167
This doesn't happen if I change it from using ".png" to "_png", same with webp files.- wolfgangmeyers2 years agoHelpful | Level 5
Workaround in place just renames the image files so they don't have an extension - https://github.com/wolfgangmeyers/aibrush-2/commit/ce1b543c2665dd5c52d8cad1f378352d9bd8d515#diff-8a564379402b12a223f373189c220ab5404f0ae74900a8f164e559bf548b522fR153
- Greg-DB2 years agoDropbox Staff
Thanks for the additional information. It looks like your posts were originally caught by the spam filter, but have since been recovered.
Anyway, from the response headers, I see that there should be a response body, since there's a response header 'Content-Length: 97'.
Using the Dropbox JavaScript SDK, you can get the result or error like in this example. Please print those out to debug this.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 5 hours agoIf 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 or Facebook.
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!