j2ee环境配置:http://blog.csdn.net/hdfyq/archive/2005/09/27/490682.aspx
asp.net 实现图片上传 http://kayalulu.com/space/820/viewspace-581 http://www.cnblogs.com/stewen/archive/2005/12/20/300587.html good
我把一个jpg文件存入sql,我怎样把这个从数据库里面读出来还原成文件?
是不是用sqldatareader.getsqlbinary()方法?怎样实现?
string strSql="select PicData from yourtable where yourID='"+strRptID+"'";
SqlDataAdapter da=new SqlDataAdapter(strSql,con);
DataTable TB = new DataTable();
da.Fill(TB);
Byte[] bt=new byte[0];
bt=(byte[])(TB.Rows[0]["PicData"]);
//建立Jpg文件,如果存在则覆盖
FileStream fs=new FileStream(yourFilePath,FileMode.Create);//yourfilepath改写你的文件名
fs.Write(bt,0,bt.Length);
fs.Close();
//至此图片已经存到你指定的文件中鸟
-----------------------------------------------------------------------------------------------------
MyEclipse5.0注册码
Subscriber: www.1cn.biz
Subscriber Code: jLR8ZC-444-55-4467865481680090