I’m downloading an excel file within C# action method the reutrns a FileResult, like this:
return File(bindata, "application/octet-stream", "mytestfile.xls");
When I manually navigate to the URL that corresponds with the above method, then I get the rendered out representation of the file. The file will not download with a Save As -dialog.
Is there a way to force the download to happen through Save As -dialog?
-pom-
I have a feeling you are getting this behavior because of the media type you are returning.
Try changing the media type to application/vnd.ms-excel like this: