cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

file downloads have wrong content-type header

file downloads have wrong content-type header

timrobinson33
Explorer | Level 4
Go to solution

Hello,

 

I'm testing out dropbox v2 files api. when I call "POST https://content.dropboxapi.com/2/files/download" API, the downloaded file seems to be always returned with the content-type header set to application/octet-stream. Am I doing something wrong or is this to be expected?

 

As far as I can tell the contents of file file are OK, it's just the header that's wrong

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Receiving a 'Content-Type: application/octet-stream' response header on a successful /2/files/download call is the expected behavior.

 

The Dropbox API doesn't return specific mime types for files, but you can get the file extension from the file name and keep your own file extension to mime type mapping as desired.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

Receiving a 'Content-Type: application/octet-stream' response header on a successful /2/files/download call is the expected behavior.

 

The Dropbox API doesn't return specific mime types for files, but you can get the file extension from the file name and keep your own file extension to mime type mapping as desired.

timrobinson33
Explorer | Level 4
Go to solution

Thanks - it seems a bit strange that a web-based file transfer API doesn't support content types but that's their decision I guess.

 

For unrelated reasons I ended up using "files/get_temporary_link" instead of "files/download" and strangely enough when you download the file from the temporary link, the content-type appears correctly. I guess this might be another workaround for someone who doesn't want to map the mime types manually

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    timrobinson33 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?