Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (5.8k points)

Our ASP.NET MVC 3 application is running on Azure and using Blob as file storage. I have the upload part figured out.

The View is going to have the File Name, which, when clicked will prompt the file download screen to appear.

Can anyone tell me how to go about doing this?

1 Answer

0 votes
by (9.6k points)

You can do it in two ways:

1. Redirect the user to blob like:

return Redirect(container.GetBlobReference(name).Uri.AbsoluteUri);

2. For private container, you can use shared access signature:

Response.AddHeader("Content-Disposition", "attachment; filename=" + name); // force download

container.GetBlobReference(name).DownloadToStream(Response.OutputStream);

return new EmptyResult();

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...