您的位置:首页 > 其它

文件下载时出现提示框不直接打开

2004-08-02 09:48 465 查看
//读取文件输出它 string strFile = "c://abc.doc"; FileStream fs = new FileStream(strFile, FileMode.Open); byte[] bytes = new byte[(int)fs.Length]; fs.Read(bytes, 0, bytes.Length); fs.Close(); Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(File.Name)); Response.BinaryWrite(bytes); Response.End();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐