Reputation: 11
I have an ASP.NET web application to download blobs from my azure storage. When I use blockBlob.DownloadToStream(fileStream); it automatically downloads it to the project location when run the web aplication in local machine. But if I want to deploy this web aplication in cloud, How can I get a dialog box to save the blobs to be dowloaded ?
Upvotes: 1
Views: 529
Reputation: 136346
There are two things you could do:
content-type
property of the blob to application/octet-stream
or don't set the content type of the blob at all. While this approach may work in most of the browsers but not in all. IE is quite smart about this would actually try to read the file type from the file stream and decides if to display the file in the browser or to prompt "Save As".Content Disposition
response header value to something like `attachment; filename="Your file name"'.Upvotes: 1