日期:2014-05-18 浏览次数:20455 次
string fileName = "开发计划.mpp";//客户端保存的文件名 string filePath = Server.MapPath("zyd??开发计划.mpp"); //路径 FileInfo fileInfo = new FileInfo(filePath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.AddHeader("Content-Length", fileInfo.Length.ToString()); Response.AddHeader("Content-Transfer-Encoding", "binary"); Response.ContentType = "application/octet-stream"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.WriteFile(fileInfo.FullName); Response.Flush(); Response.End();