可以让保存在数据库中的文件查出 并被下载

 AttachFile attachFile = new AttachFile(contentId, DMSHelper.Database);

//将文件保存到本机上
                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(attachFile.Title + "." + attachFile.DataType));
                Response.AddHeader("Content-Length", attachFile.Data.Length.ToString());
                Response.ContentType = "application/octet-stream";
                Response.Filter.Close();
                Response.BinaryWrite(attachFile.Data);
                Response.Flush();

posted @ 2013-08-23 09:50  fulai_xy  阅读(164)  评论(0编辑  收藏  举报