Posted
Filed under C#
[원문] - http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=320

<%@ Page language="C#" debug="true" %>
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e) {
Response.ContentType="application/zip";
Response.AppendHeader("Content-Disposition","attachment; filename=myzipfile.zip");
Response.WriteFile(@"c:\inetpub\wwwroot\myzipfile.zip");
Response.Flush();
}
</script>

N.B. Reader Shaun College added the following to chop off the extra junk that may be sent by the ASP.NET runtime along with your file:

Response.AddHeader ("Content-Length", FileSize.ToString());
2010/04/02 09:18 2010/04/02 09:18