Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Returning a file

$
0
0

I am also on MVC6 and have issues with Response.Headers even after adding  "Microsoft.Net.Http.Server": "1.0.0-rc1-final".  First it wants an instance of Response.  Then if you create an instance, it needs a constructor with arguments but doesn't provide any hints and I couldn't find any one google.

Also, I also get an error that 'File' cannot be used as a method when I try to return the file:

return File(System.IO.File.ReadAllBytes(@"D:\MyFiles\Resume.doc"), "application/ms-word", "Resume.doc");

Any suggestions?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>