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

Download Files using Core

$
0
0

Hi,

In MVC 5, I use the code below to download/stream a file but what is the equivalent in Core?

[HttpGet]public FileResult DownloadFile()
{    string fileName = $@"\folder\filename.pdf";    string contentType = "application/pdf";    return File(fileName, contentType);
}

Using the code above in Core doesn't hit any breakpoint at all.

Thanks,


Viewing all articles
Browse latest Browse all 9386

Trending Articles



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