文件下载方法

    技术2022-05-11  64

    private void FileDownload(string FullFileName) {     FileInfo DownloadFile = new FileInfo(FullFileName);     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.UTF8));     Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());     Response.WriteFile(DownloadFile.FullName);     Response.Flush();     Response.End(); }

    Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=671406

     

    最新回复(0)