tags:

views:

95

answers:

1

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");
A: 

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.

çağdaş
Thanks but was hoping for a better answer; I've got to believe that there's a way to do this; how do I elevate this question again so it gets reviewed or noticed?
Jeff Rubingh
@Jeff Rubingh, The site will bump your question from time to time as long as it doesn't have an accepted answer. You can also try editing your question and adding more information to bump it. As for the question, imagine how it would be if browsers allowed all the sites in the world to open new browser instances. So, there's a reason why it's not allowed.
çağdaş