Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

cristiz1992's avatar
cristiz1992
Explorer | Level 3
8 years ago
Solved

Generated temporary link, content type is not correctly set

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

  • Greg-DB's avatar
    Greg-DB
    8 years ago
    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.

4 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    I just tried this out and it is working properly for me. Can you share the code you're using? Thanks in advance!
  • cristiz1992's avatar
    cristiz1992
    Explorer | Level 3
    8 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    The correct Content-Type should be returned now, even when using file ID. Hope this helps!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If 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, Facebook or Instagram.

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!