Last post Sep 01, 2017 02:31 PM by Dmitry Sikorsky
Sep 01, 2017 02:25 PM|imperialx|LINK
In MVC 5, I use the code below to download/stream a file but what is the equivalent in Core?
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.
Sep 01, 2017 02:31 PM|Dmitry Sikorsky|LINK
Hi! This is about images, but it is the same for other types of files: https://github.com/DmitrySikorsky/AspNetCoreImageResizingService/blob/master/AspNetCoreImageResizingService/Controllers/ImageController.cs#L29