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

 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();

原文地址:https://www.cnblogs.com/fulai/p/3276877.html