Reputation: 1188
So I know this is not the best practice, but right now it has to been done.
In a HttpPost ActionResult, a PDF is generated and then put on a stream so a user can download it. This works great. However in the controller that is responsible for the PDF, we need it to redirect to another view. This is an issue since it is return a File, not a RedirectToAction.
Any thoughts on how we can get the PDF downloaded and have a page Redirect?
Upvotes: 1
Views: 777
Reputation: 1606
You can't return the redirect request on the response that is sending the download, so I'd try creating an IFrame or a new window for the download and then do a redirect clientside. The flow could be ajax request to get the download url + redirect url, start the download via new window, and redirect.
Upvotes: 1