从数据库读出文件并存到byte数组,filename是从数据库中读出的文件的名字。然后用二进制写出来就可以了。
byte [] t=(byte[])sdr.GetValue(1);
Response.ContentType="application/x-www-form-urlencoded";
Response.AppendHeader("Content-disposition","attachment; filename="+HttpUtility.UrlEncode(filename));
Response.BinaryWrite(t);
Response.End();
byte [] t=(byte[])sdr.GetValue(1);
Response.ContentType="application/x-www-form-urlencoded";
Response.AppendHeader("Content-disposition","attachment; filename="+HttpUtility.UrlEncode(filename));
Response.BinaryWrite(t);
Response.End();
http://dotnet.aspx.cc/ShowDetail.aspx?id=EY1XLDYV-PIDF-43LO-1WFL-FMY5ALE1F635
http://support.microsoft.com/default.aspx?scid=kb;en-us;812406&Product=aspnet
----------------------------------------------------------------------
欢迎试用ASP.NET大文件上传组件(AspnetUpload 1.0 Release & 无刷新进度条)
http://bestcomy.europe.webmatrixhosting.net
----------------------------------------------------------------------
string VirtualPath = FileDownloadVirtualDir + "/"+ File_Name;Page.Response.Clear();
Page.Response.AddHeader( "Content-Type", "text/htm" ); //类型根据实际调整
Page.Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(Server.MapPath(VirtualPath)));
Page.Response.WriteFile(File_Name);
Page.Response.End();
我猜 我猜 我猜猜猜
哈哈...