添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
FileStreamResult File(Stream fileStream, string contentType, bool enableRangeProcessing);
VirtualFileResult File(string virtualPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
VirtualFileResult File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
VirtualFileResult File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
VirtualFileResult File(string virtualPath, string contentType, string fileDownloadName, bool enableRangeProcessing);
VirtualFileResult File(string virtualPath, string contentType, string fileDownloadName);
VirtualFileResult File(string virtualPath, string contentType, bool enableRangeProcessing);
VirtualFileResult File(string virtualPath, string contentType);
FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
FileStreamResult File(Stream fileStream, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
FileStreamResult File(Stream fileStream, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName, bool enableRangeProcessing);
FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName);
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
VirtualFileResult File(string virtualPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
FileContentResult File(byte[] fileContents, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing);
FileContentResult File(byte[] fileContents, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag);
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName, bool enableRangeProcessing);
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName);
FileContentResult File(byte[] fileContents, string contentType, bool enableRangeProcessing);
FileContentResult File(byte[] fileContents, string contentType);
FileStreamResult File(Stream fileStream, string contentType);

If your file stored in Azure Blob, there are two ways you can get it and download it via your ASP.NET Core web api: 1. download to a byte array from Azure Blob, and return File object with this byte array. 2. open a read stream of Azure Blob and return File object with this stream.

I’ve noticed that, if download to byte array and return it, this approach will cause a little memory leak and for a while, ASP.NET Core application will consume more and more memory, I guess because application host lots of byte array and GC sometimes will not collect them. When I switch to stream approach, the memory leak problem is gone. I guess because the download will let caller to get stream from blob directly, there is no byte array host in our application domain.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy