I have a following action on my MVC Controller:
public async Task<FileStreamResult> Contact()
{
IAmazonS3 s3Client = GetS3Client();
GetObjectRequest request = new GetObjectRequest
{
BucketName = bucketName,
Key = objectKey,
};
GetObjectResponse response = await s3Client.GetObjectAsync(request).ConfigureAwait(false);
return File(response.ResponseStream, "application/octet-stream", "SomeFile.exe");
}
The files I am testing are ~10-30MB.
When this action is triggered by a button on the page, the download start is not indicated. The browser silently waits for the file to be fully available (which takes quite a lot of time), and then it suddenly shows them as downloaded.
Why doesn't it show that the download is started and is in progress? How to enable that?
The files are quite large, and I want them to be sent/streamed to the client without being loaded to memory or pre-saved on my server, so I suppose this is what the FileStreamResult is for?