0 votes
1 view
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.5k 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();

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...