如何从数据库中下载文件:亲爱的
这是我在我的网页,用于从数据库中下载文件的代码。我已经存储在VARBINARY格式。当我点击LinkButton的,该文件有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控件内。现在,它的工作时,我放在外面的控制面板。但我需要知道是什么原因。
关于
谢赫