0

I want to send the files in filestreams of size more than 800 MB from controller to UI.

Is there any method to send the filestream from controller to browser in chunks.

because if I use

File(downloadStream, "application/octet-stream", fileName);

is taking system memory and not able to send it to UI.

Please suggest the most efficient way of sending the filestream in chunks .

4

1 回答 1

1

使用 FilePathResult,它使用 HttpResponse.TransmitFile 将文件直接写入 http。此方法不会在服务器的内存中缓冲文件,因此它应该是发送较大文件的更好选择。

在这里查看它的实现

于 2012-06-09T07:16:04.047 回答