相关疑难解决方法(0)

使用FileStream ASPNET发送大文件500MB时出现OutOfMemoryException

我正在使用Filestream读取大文件(> 500 MB),我得到了OutOfMemoryException.

我使用Asp.net,.net 3.5,win2003,iis 6.0

我希望在我的应用中:

Read DATA from Oracle

Uncompress file using FileStream and BZip2

Read file uncompressed and send it to asp.net page for download.

When I read file from disk, Fails !!! and get OutOfMemory...

. My Code is:

using (var fs3 = new FileStream(filePath2, FileMode.Open, FileAccess.Read)) 
        { 
          byte[] b2 = ReadFully(fs3, 1024); 
        } 

 // http://www.yoda.arachsys.com/csharp/readbinary.html
 public static byte[] ReadFully(Stream stream, int initialLength) 
  { 
    // If we've been passed an unhelpful initial length, just 
    // use …
Run Code Online (Sandbox Code Playgroud)

asp.net download stream out-of-memory filestream

9
推荐指数
1
解决办法
7859
查看次数

标签 统计

asp.net ×1

download ×1

filestream ×1

out-of-memory ×1

stream ×1