처음에는 Response.Close와 Response.End의 차이점을 알아 내려고했지만 더 많은 인터넷 검색 및 연구를 수행 한 결과 일반적인 것을 보지 못했습니다. way Byte [] 클라이언트로 다시 보내집니다. 코드 샘플을 아래에 남겨 두겠다.하지만 업계 표준이 이것을 어떻게하는지 알고 싶다.ASP.NET 사용자에게 파일을 스트리밍하는 방법
Byte[] myBytes = GetReportBytes();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AppendHeader("content-length", myBytes.Length.ToString());
HttpContext.Current.Response.AppendHeader("content-Disposition", "attachment;filename=" + this.ReportFileName + GetReportExtension());
HttpContext.Current.Response.ContentType = GetApplicationContentType();
HttpContext.Current.Response.BinaryWrite(myBytes);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
//CERT FIX
//HttpContext.Current.Response.End();
정보 주셔서 감사합니다 ... – RSolberg
@Mitch - 나는 일반적인 방법으로 스트리밍하는 방법에 대해 조금 더 변하고 있습니다. 나는 이것에 대한 표준을 실제로보고 있지 않으며 거기에서 시작하고 싶습니다. – RSolberg
그래서 파일을 스트리밍 할 때 Response.Close() 또는 Response.End()를 호출하지 않습니까? Response.Flush()를 호출하여 버퍼에서 파일을 보내고 메서드를 끝내시겠습니까? – StuperUser