zifeng759/
共23个网摘 [
1 ] |
访问zifeng759的个人空间
zifeng759收录,时间:2008-1-11 16:57:57 | 相关网摘,我也收藏
public void FileDownload(string FullFileName)
{
System.Web.HttpContext context = System.Web.HttpContext.Current;
FileInfo DownloadFile = new FileInfo(FullFileName);
context.Response.Clear();
context.Response.ClearHeaders();
context.Response.Buffer = false;
context.Response.ContentType = "application/octet-stream ";
//Response.ContentType = "application/ms-excel ";
context.Response.AppendHeader( "Content-Disposition ", "attachment;filename= " HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
context.Response.AppendHeader( "Content-Length ", DownloadFile.Length.ToString());
context.Response.WriteFile(DownloadFile.FullName);
context.Response.Flush();
context.Response.End();
}
http://topic.csdn.net/u/20070910/20/c4b5593a-5842-43de-a665-cd00a3cc9b0a.html
共23个网摘 [
1 ]