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 no payload. If I download the corresponding .json file with image metadata, it downloads with no problem. Seems like an api issue.
Well, it has mysteriously stopped happening since I reported it. Someone must have caught the bug and fixed it 🙂
- wolfgangmeyersHelpful | Level 5
Update - if I rename a file with a .webp or .png extension to end in _webp or _png respectively, the download works.
- Greg-DBDropbox 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.
- wolfgangmeyersHelpful | 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. - wolfgangmeyersHelpful | 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?
- wolfgangmeyersHelpful | 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"
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 4 days 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!