How do I get FileResult to open a pdf in a new browser instance? I am returning FileStreamResult from a controller like so:
return new FileStreamResult(new FileStream(path, FileMode.Open), "application/pdf");
How do I get FileResult to open a pdf in a new browser instance? I am returning FileStreamResult from a controller like so:
return new FileStreamResult(new FileStream(path, FileMode.Open), "application/pdf");
There's no way to do this on the server-side.
You can try to have a pop-up link (which I suggest you don't) that points to your action but even then it's not guaranteed to work.