cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

Generated temporary link, content type is not correctly set

Generated temporary link, content type is not correctly set

cristiz1992
Explorer | Level 3
Go to solution

Hi,

 

I've used the api to generate a temporary link and I've accessed it, but the Content-Type header is set to application/octet-stream instead of video/x-matroska. Obviously my file's extension is '.mkv'.

In the endpoint's description https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_link it says that the mime type is set to the file's mime type.

 

Can you help me with this issue?

 

Thanks

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Thanks! The endpoint itself does accept file ID, but the mime type detection is based on file extension, which is missing when a file ID is used.

As a workaround, please do use the file path if you need the specific Content-Type value there. I'll ask the team to look into if we can get this to return the expected value even when the file ID is used, but I can't guarantee if/when that would be.

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution
I just tried this out and it is working properly for me. Can you share the code you're using? Thanks in advance!

cristiz1992
Explorer | Level 3
Go to solution

Hello,

 

I was calling the get_temporary_link endpoint using the fileid instead of the path.

I tried using the path and the content type header gets correctly set.

 

Does Dropbox support fileid for this endpoint? I saw in the regexp that you allow strings that start with id: ?

 

Thanks

Greg-DB
Dropbox Staff
Go to solution
Thanks! The endpoint itself does accept file ID, but the mime type detection is based on file extension, which is missing when a file ID is used.

As a workaround, please do use the file path if you need the specific Content-Type value there. I'll ask the team to look into if we can get this to return the expected value even when the file ID is used, but I can't guarantee if/when that would be.

Greg-DB
Dropbox Staff
Go to solution
The correct Content-Type should be returned now, even when using file ID. Hope this helps!
Need more support?
Who's talking

Top contributors to this post

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