日期:2014-05-18 浏览次数:20474 次
string strFileName = this.DataList1.DataKeys[e.Item.ItemIndex].ToString();//文件名
string FullFileName = Page.Server.MapPath("Uploadfiles/") + strFileName;//文件的全路径名
FileInfo DownloadFile = new FileInfo(FullFileName);
Response.Clear();
Response.Charset = "utf-8";
Response.Buffer = true;
this.EnableViewState = false;
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AppendHeader("Content-Disposition ", "attachment;filename=" + strFileName);
Response.ContentType = "application/unknown ";
Response.WriteFile(FullFileName);
Response.Flush();
Response.Close();
Response.End();