PROWAREtech
ASP.NET: Download Files
How to download files to the browser from the server using Web Forms (.NET Framework).
Download any file type from a web form in ASP.NET. This example downloads zip files.
<%@ Page Language="C#" ContentType="application/x-zip-compressed" %>
<%
Response.Clear();
Response.AppendHeader("content-disposition", "attachment;filename=" + Request.QueryString["file"]);
string file = Server.MapPath("/zipfiles/" + Request.QueryString["file"].Replace("../", ""));
Response.WriteFile(file);
Response.End();
%>
Comment