Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4627250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:32:28+00:00 2026-05-22T03:32:28+00:00

I have an MVC web app running in azure that serves up large files

  • 0

I have an MVC web app running in azure that serves up large files like mp3’s, pdf’s, etc… that are stored in cloud storage. What’s the best way to serve those files, so users can download them when clicking on a link/button?

The easy way is just to show them with:

<a href="...blob.core.windows.net/container/file.mp3">

But then the user has to right-click to download.

To force a download, you can return a File ActionResult:

public ActionResult GetPDF( string filename )
{
    return File( filename, "application/pdf", Server.HtmlEncode( filename ) );
}

The drawback with this ( I think ) is that the webrole has to read in the files and output them to the stream, which would consume resources, and potentially bog down the role with lots of users. Whereas the simple href link solution basically hands off the work so the browser talks directly to cloud storage.

Am I correct? Should I be concerned about the extra work on the webrole?

Is there another way to force a file download without burdening the webrole?

UPDATE:

So what I ended up doing was uploading the mp3’s with Content-Type “binary/octet-stream” – this seems to force a download prompt. Not sure if it’s a good practice, but it works so far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:32:29+00:00Added an answer on May 22, 2026 at 3:32 am

    Your assumption is correct, if you want to use the ActionResult you would need to download the file to the web role first and then stream it down to the client. If you can you want to avoid this particularly with large files and leave it up to Azure Storage because then Microsoft has to worry about dealing with the request, you don’t have to pay for more web roles if you get lots of traffic.

    This works well if all of the files you’re hosting are public, but gets a little trickier if you want to secure the files (look into shared access signatures if that it what you want to do).

    Have you tried setting the content type on the blob? Depending on how you’ve uploaded the files to blob storage they may not be set. If you’re uploading the blobs through your own code you can access this through CloudBlob.Attributes.Properties.ContentType (from MSDN)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this web app that is running ASP .NET MVC 1.0 with LINQ
I have C# MVC web app that has some textboxes that in IE9 you
I have a spring web app that uses Hibernate and Velocity. It's an MVC
I have an asp.net mvc web app that has controllers with role attributes on
I have a Spring MVC web app running on my server. Recently I wanted
I have an asp.net MVC web app running on mod-mono under Apache2 on Ubuntu
I have an MVC 3 web app that has an Action which I need
I have an asp.net mvc app that is built to run as standard web
I have a web app running Spring 3.0 and using Spring-MVC. I have a
I have an object which contains models for my ASP.NET MVC web app. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.