返回首页

如何从数据库中下载文件:亲爱的

这是我在我的网页,用于从数据库中下载文件的代码。我已经存储在VARBINARY格式。当我点击LinkBut​​ton的,该文件有open.but我得到javscript错误。请帮助我理清。


byte[] fileData =(byte[])ds.Tables[0].Rows[0][3];

            Response.ClearContent();

            Response.AddHeader("Content-Disposition", "attachment; filename=1.xls"); // + ds.Tables[0].Rows[0][2]);

            System.IO.BinaryWriter bw = new System.IO.BinaryWriter(Response.OutputStream);

            bw.Write(fileData);

            bw.Close();

            Response.ContentType =ds.Tables[0].Rows[0][4].ToString()  ;

            Response.End();


问题是,FileUpload控件保持AJAX UpdatePanel控件内。现在,它的工作时,我放在外面的控制面板。但我需要知道是什么原因。

关于
谢赫

回答

评论会员:游客 时间:2012/02/07
|thatraja:您没有提供完整的细节,在你的问题。已经回答过类似的问题,这里的Q/A节之前,检查一下。imgsrc=]
王子安东尼G
评论会员:{的C2}{体C3} 时间:2012/02/07