-
Notifications
You must be signed in to change notification settings - Fork 524
SendFileAsync has problem in core 1.1 #1375
Comments
@alireza-naghizadeh Thanks for the bug report. Would it be possible to capture server-side console logs during a failed request made to a 1.1 server. My current theory is that something in the application pipeline is throwing an exception. It could either be SendFileAsync or some other middleware. Console logs could help us determine if that's really the case. |
There isn't any custom middleware! Please, Do these steps to simulate this problem:
|
This is the console logs of this project:
|
You might be running into this aspnet/Mvc#5555 |
The work around is to use the proper action result, either PhysicalFile or File: public IActionResult Test()
{
return PhysicalFile("c:\\test.jpg", "image/jpeg");
} |
That was a sample to show the bug (problem)... |
You you elaborate? What component are you in that you only have access to the response object. The work around is to avoid writing to the response directly in the action method. You can do that by using a built in or custom action result. If you can be more specific about what you're problem is (maybe posting a real sample), then we can help. |
I have a temporary solution for now, but when and how you can solve the main problem?! |
See the issue I linked to aspnet/Mvc#5555 |
@alireza-naghizadeh If the console logs you provided were from your simplified repo, it might help to include the console logs from your real application taken when the error occurs. If not, you really are running into aspnet/Mvc#5555 which will be fixed. My bet is that something is throwing an exception before the file can be (fully) written. |
Hi,
After updating from asp.net core 1.0 to 1.1
Response.SendFileAsync(...) works but in client side I have this error:
...ERR_INCOMPLETE_CHUNKED_ENCODING
I have a bad solution for now! by change "Microsoft.AspNetCore.Server.Kestrel" version to 1.0.2 or lower in "project.json" file...
What is the problem?! Why the server connection is alive after sending file?!
Thanks
The text was updated successfully, but these errors were encountered: