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

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

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.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    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

      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 Staff rankDropbox Staff
        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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 4 days ago
333 Following

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 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!