下载 byte[] 文件

   if (ContentByte == null)
                return;
            string downLoadFileName = Name + "." + ByteUitl.FileType(ContentByte);
            Response.ContentType = "application/octet-stream";
            //通知浏览器下载文件而不是打开
            Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(downLoadFileName, System.Text.Encoding.UTF8));
            Response.BinaryWrite(ContentByte);
            Response.Flush();
            Response.End();
posted @ 2011-05-09 16:59  Wythe  阅读(705)  评论(0编辑  收藏  举报