cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

409 error when attempting to download image files

409 error when attempting to download image files

wolfgangmeyers
Helpful | Level 5
Go to solution

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.

1 Accepted Solution

Accepted Solutions

wolfgangmeyers
Helpful | Level 5
Go to solution

Well, it has mysteriously stopped happening since I reported it. Someone must have caught the bug and fixed it 🙂

View solution in original post

12 Replies 12

wolfgangmeyers
Helpful | Level 5
Go to solution

Update - if I rename a file with a .webp or .png extension to end in _webp or _png respectively, the download works.

Greg-DB
Dropbox Staff
Go to solution

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.

wolfgangmeyers
Helpful | Level 5
Go to solution

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.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-US;q=0.9
Authorization: Bearer <redacted>
Connection: keep-alive
Content-Length: 0
Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}
Host: content.dropboxapi.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"


Response Headers:

HTTP/1.1 409 Conflict
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Accept-Ranges, Content-Range, ETag, Dropbox-API-Result
Cache-Control: no-cache
Content-Security-Policy: sandbox allow-forms allow-scripts
X-Content-Type-Options: nosniff
Content-Type: application/json
Accept-Encoding: identity,gzip
Date: Mon, 31 Jul 2023 16:55:48 GMT
Server: envoy
Content-Length: 97
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Robots-Tag: noindex, nofollow, noimageindex
X-Dropbox-Response-Origin: far_remote
X-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.

wolfgangmeyers
Helpful | Level 5
Go to solution

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?

wolfgangmeyers
Helpful | Level 5
Go to solution

Request headers:

POST /2/files/download HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-US;q=0.9
Authorization: Bearer <redacted>
Connection: keep-alive
Content-Length: 0
Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}
Host: content.dropboxapi.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"

wolfgangmeyers
Helpful | Level 5
Go to solution

Response Headers:

HTTP/1.1 409 Conflict
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Accept-Ranges, Content-Range, ETag, Dropbox-API-Result
Cache-Control: no-cache
Content-Security-Policy: sandbox allow-forms allow-scripts
X-Content-Type-Options: nosniff
Content-Type: application/json
Accept-Encoding: identity,gzip
Date: Mon, 31 Jul 2023 16:55:48 GMT
Server: envoy
Content-Length: 97
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Robots-Tag: noindex, nofollow, noimageindex
X-Dropbox-Response-Origin: far_remote
X-Dropbox-Request-Id: 05ee6d257ece4f0e849a94b9d15d4fa3

wolfgangmeyers
Helpful | Level 5
Go to solution

Request Headers:

POST /2/files/download HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-US;q=0.9
Authorization: Bearer ...
Connection: keep-alive
Content-Length: 0
Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}
Host: content.dropboxapi.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"

wolfgangmeyers
Helpful | Level 5
Go to solution
Request headers:

POST
/2/files/download HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-US;q=0.9
Connection: keep-alive
Content-Length: 0
Dropbox-API-Arg: {"path":"/0d433c25-8365-4933-a96f-6f07543a899f.png}"}
Host: content.dropboxapi.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
 

wolfgangmeyers
Helpful | Level 5
Go to solution

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    wolfgangmeyers Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?