none
Force file download for IE9 on Azure Blob Storage RRS feed

  • Question

  • Hello,

    I am trying to use Azure Blob Storage as a location for secure file downloads using Shared Access Signature. Everything is working very well, however the problem I am having is I am trying to allow the user to save files from the browser and I have all browsers except IE9 working.

    Reviewing this question,

    What content type to force download of text response?

    this works well when I can control all of the headers, however in Azure Blob Storage, I have set the Content-Type to application/octet-stream and this allows all browsers except IE to ask the user to save the file, IE simply opens the file. It appears that known file types will open (example .jpg, .wmv etc…).

    In Azure, I have found no way to set

    Content-Disposition: attachment;filename="My Text File.txt" 
    

    Is there a way, using Azure Blob Storage, to use IE to download any file directly from Azure Blob Storage?

    Thanks in advance.

    Sunday, November 27, 2011 4:52 PM

Answers

  • Hi,

    Actually, we can't set Content-Disposition for blobs, and I can't think of any other workarounds. From my experience, in most case IE's behavior is fine. I would like to know why you have to prompt a download? The user can see the text file, and if they wish to save it locally, they have more than one way to do that (copy paste, save file, etc.). If they simply want to read the text and then forget it, that's also fine. They don't even have to download it and then double click a local file to read the content.
     
    If you have to modify the behavior, the only workaround I can think of is to use a web role as an intermediate bridge, and add the Content-Disposition from your web role.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Monday, November 28, 2011 7:31 AM
    Moderator

All replies

  • Hi,

    Actually, we can't set Content-Disposition for blobs, and I can't think of any other workarounds. From my experience, in most case IE's behavior is fine. I would like to know why you have to prompt a download? The user can see the text file, and if they wish to save it locally, they have more than one way to do that (copy paste, save file, etc.). If they simply want to read the text and then forget it, that's also fine. They don't even have to download it and then double click a local file to read the content.
     
    If you have to modify the behavior, the only workaround I can think of is to use a web role as an intermediate bridge, and add the Content-Disposition from your web role.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Monday, November 28, 2011 7:31 AM
    Moderator
  • Hi,

    I will mark the reply as an answer. If you find it no help, please feel free to unmark it and follow up.

    Thanks.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Sunday, December 4, 2011 4:05 PM
    Moderator
  • Since version 2013-08-15 of Azure Blob API it's possible to set Content-Disposition header for a blob (by sending x-ms-content-disposition).

    The bad thing is that Content-Disposition is not returned on GET/HEAD requests if appropriate x-ms-version header was not specified in the request. May be this is not a problem for SDK client, but IT IS for web browsers. Browsers can't send this header because they have no idea what it is, and this makes hosting data files in Azure less usable.

    Is there any way I can create a feature request?


    • Edited by IvanP_CBL Thursday, April 17, 2014 2:35 PM
    Thursday, April 17, 2014 2:34 PM
  • Is this still not possible for web browsers? has this feature been  included now?
    Friday, August 16, 2019 7:41 AM
  • @niveditaece May I know what exactly are you trying to perform (Can you bit elaborate more on the issue)?

    Wednesday, August 21, 2019 1:47 PM
    Moderator