在Oracle中存取BLOB对象实现文件的上传和下载[13]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

        Blob blob = rs.getBlob(1);

        InputStream ins = blob.getBinaryStream();

 

 

 

        response.setContentType("application/unknown");

        response.addHeader("Content-Disposition", "attachment; filename="+"output.txt");

 

 

 

        OutputStream outStream = response.getOutputStream();

        byte[] bytes = new byte[1024];

        int len = 0;

        while ((len=ins.read(bytes))!=-1) {

            outStream.write(bytes,0,len);

        }

        ins.close();

        outStream.close();

        outStream = null;

        con.commit();

        con.close();

      }

%>

本文关键:在Oracle中存取BLOB对象实现文件的上传和下载
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top