FileInfo DownloadFile = new FileInfo(FullFileName); //文件绝对路径 if (DownloadFile.Exists) { response.Clear(); response.ClearHeaders(); response.Buffer = false; response.ContentType = "application/octet-stream"; response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.ASCII)); response.AppendHeader("Content-Length", DownloadFile.Length.ToString()); response.WriteFile(DownloadFile.FullName); response.Flush(); // response.End();
}