Explore Courses Blog Tutorials Interview Questions
0 votes
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


return new EmptyResult();

Browse Categories