Reputation: 2881
I am loading an image from S3 bucket as byte[]
and send it as a response from my asp.net core 3.1 web API controller method.
Here is my code:
public async Task<IActionResult> GetImage(string documentId, int pageId)
{
var imageArray = await _documentService.GetImage(documentId, pageId);
return File(imageArray, "image/png");
}
It works to an extend. The Response is delivered to the client:
But the image itself is never fully loaded:
sometimes it loads just a little bit:
sometimes a bit more:
But never the full image. Looks like it interrupts for whatever reason and just sends whatever got into the initial buffer.
Upvotes: 0
Views: 152
Reputation: 2881
Thanks to @Athanasios - the issue is not related to the File response. I wasn't reading the S3 stream properly. The error has gone after fixing it.
Upvotes: 0