asp.net core MVC Write Report to File? Not Download
i will create a report in .net core mvc with jsreport.
The pdf should write in a file, not as download. How can i do this?
In "OnAfterRender" function, i read the r.Content Stream. But my code excepted with a Message. ("Can't read a closed stream")
Thank you for helping.
Does the error "Can't read a closed stream" come from your reading? Isn't it thrown afterwards?
I guess that it is thrown afterwards and it is because you read and close the stream, but the middleware tries to read it after the
You can try to set to the
r.Contentthe stream you actually want to return back to the response.