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