title: How to add a file attachment to the Response when the file path is a URI in MVC.NET Actions?
body: <p>I have a URL to a file, "<a href="http://mydomain.domain.com/files/somefile.mp3" rel="nofollow noreferrer">http://mydomain.domain.com/files/somefile.mp3</a>".</p>
  
  <p>I also have an Action in my Controller.</p>
  
  <p>I want the action to return the file as an attachment.</p>
  
  <p>I know I can do this:</p>
  
  <pre><code>Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName)
  Response.AddHeader("Content-Length", lenOfFile)
  Response.ContentType = "application/octet-stream" 
  </code></pre>
  
  <p>But does that mean that the return type of the Action is void? And then what do I call to tell it to send?</p>
  
  <p>I also tried:</p>
  
  <pre><code>return File(new FileStream(a.AssetPath, FileMode.Open), "application/octet-stream");
  </code></pre>
  
  <p>when the return type of the Action was FileStreamResult but it did not like the fact that my path was a URL.</p>