private void FileDownload(string FullFileName) //下载xml文件
{
FileInfo DownloadFile = new FileInfo(FullFileName);
this.Response.Clear();
this.Response.ClearHeaders();
this.Response.Buffer = false;
this.Response.ContentType ="application/octet-stream";
this.Response.AppendHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
this.Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
this.Response.WriteFile(DownloadFile.FullName);
this.Response.Flush();
this.Response.End();
}
给一个完整的 绝对路径 就OK!!
------------------------广告之家 http://www.adggs.com