Author: MrCool | Posted on: 10/4/2009 11:46:49 PM | Views : 238

hi all,
i doing a aspx to let user download a zip file. i google and wat i got from the web is like code below:
string filename = Request.QueryString["filename"].ToString(); string filepath = CG.AppSettings["dirExportPath"].ToString() + "\\" + filename; FileInfo file = new System.IO.FileInfo(filepath); Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename); Response.AppendHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(file.FullName); Response.Flush(); File.Delete(filepath); Response.Flush(); Response.End(); ...

Go to the complete details ...