title: best way to download large files from azure cloud storage
body: <p>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?</p>
  
  <p>The easy way is just to show them with:</p>
  
  <p><code>&lt;a href="...blob.core.windows.net/container/file.mp3"&gt;</code></p>
  
  <p>But then the user has to right-click to download.</p>
  
  <p>To force a download, you can return a File ActionResult:</p>
  
  <pre><code>public ActionResult GetPDF( string filename )
  {
      return File( filename, "application/pdf", Server.HtmlEncode( filename ) );
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>Am I correct?  Should I be concerned about the extra work on the webrole? </p>
  
  <p>Is there another way to force a file download without burdening the webrole?</p>
  
  <p>UPDATE:</p>
  
  <p>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.</p>