다운로드 할 데이터가 상당히 많습니다. 그러나ASP.NET C#으로 즉시 다운로드를 수행하는 방법?
HttpContext.Current.Response.AppendHeader("content-disposition", String.Format("attachment; filename={0}", filename)); HttpContext.Current.Response.BinaryWrite(ms.ToArray()); HttpContext.Current.Response.End();
, 그것은에 파일을 기다리고, 서버 메모리의 광대 한 양을 사용하고 있습니다 :
현재 우리의 시스템은 스트림을 (우리가 파일을 사용하지 않는)코드 출력 다운로드 ... 기다리는 것보다 즉시 다운로드하기 시작합니다. 어떻게해야합니까? 이 설정
이 질문에서 다루는 내용은 다음과 같습니다. http://stackoverflow.com/questions/6781732/unbuffered-output-from-ihttphandler –