把文件写入response流,怎么能做到直接在客房浏览上打开,而不是提示 打开,保存或取消. 我把一个word或execl文件写入 response流中.输出.这样的话在客户机浏览器会提示 打开,保存,取消.怎么样写,可以直接在浏览上把word或execl打开显示出来? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Response.AddHeader("Content-Disposition", "attachment; filename=" + sTmpFileName);下载Response.AddHeader("Content-Disposition", "inline; filename=" + sTmpFileName);直接打开 FileStream fs = new FileStream(docFile.FileView, FileMode.Open); Response.Clear(); byte[] bt = new byte[fs.Length - 1]; fs.Read(bt, 0, int.Parse(fs.Length.ToString()) - 1); Response.OutputStream.Write(bt, 0, int.Parse(fs.Length.ToString()) - 1); Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "inline; filename=" + docFile.FileName + "." + docFile.FileTypeName); Response.End(); fs.Close(); fs.Dispose();---------瞧下我写错没 这应该是取决于客户端IE的设置,如果第一次弹出来,上面不是有什么以后就以相同的方式操作的CheckBox吗? 安装了 world的话 会直接在IE出来吧? 问下NameValueCollection 这个类是什么意思 使用<object>标签,js弹出窗口问题,急! fileupload用不了啦 求一正则表达式 江湖救急~~~~~~~~! Ajax问题 很疑惑的问题 在web应用程序中,如何取得dataset中当前的数据是第几行吗,如何在dataset中的当前行移动到下一行或上一行? 蛙蛙请教:web项目的数据库迁移问题 LigerUI前端技术实现的管理平台精讲 为什么页面参数传递后中文显示成为??的 如何在控件绑定一个函数
下载
Response.AddHeader("Content-Disposition", "inline; filename=" + sTmpFileName);
直接打开
Response.Clear();
byte[] bt = new byte[fs.Length - 1];
fs.Read(bt, 0, int.Parse(fs.Length.ToString()) - 1);
Response.OutputStream.Write(bt, 0, int.Parse(fs.Length.ToString()) - 1);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "inline; filename=" + docFile.FileName + "." + docFile.FileTypeName);
Response.End();
fs.Close();
fs.Dispose();---------
瞧下我写错没