ie中打开数据库中的文件

来源:互联网 发布:影楼美工招聘兼职 编辑:程序博客网 时间:2024/06/05 17:13

OldName =OldName.Substring(OldName.LastIndexOf(@"/")+1);

   Response.ClearHeaders();
   Response.Charset = "gb2312";
   Response.AddHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(OldName,Encoding.UTF8).Trim());
      Response.AddHeader("Content-Length",filebuff.Length.ToString());
   Response.ContentType = "application/octet-stream";
   Response.BinaryWrite(filebuff);
   Response.End();

其中content-disposition 的值ATTACHMENT为再外部程序中打开,例如word;inline为再ie中嵌入式打开

原创粉丝点击