我在Oracle的blob字段里写了一个文件,现在我要下载它,用了如下的代码:request.setCharacterEncoding("GB2312");
String mod = request.getParameter("mod");
String type = request.getParameter("type");
String name = request.getParameter("name");
Connection con = PoolManager.getConnection();
con.setAutoCommit(false);
Statement st = con.createStatement();
String strSQL = "select file_name from t_yzs_pact_admin where mod='" + mod + "' and  type='" + type +"' and name='" + name + "'";
ResultSet rs = st.executeQuery(strSQL);
String strFileName = null;
if(rs.next())
strFileName = rs.getString("FILE_NAME");strSQL = "select pact from t_yzs_pact_admin where mod='" + mod + "' and type='" + type
+"' and name='" + name + "'";
rs = st.executeQuery(strSQL);if (rs.next()){
Blob blob = rs.getBlob(1);
InputStream ins = blob.getBinaryStream();
response.setContentType("application/unknown");
response.addHeader("Content-Disposition", "attachment;filename="+java.net.URLEncoder.encode(strFileName,"UTF-8")); 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();
}现在的问题是,假如这个文件叫download.jsp,那如果我在我的一个页面里面写
<a href='download.jsp'>download</a>
当点击链接的时候,弹出一个文件下载对话框,我点“打开”,因为我这是一个图片,所以就会调用我的图片浏览工具打开文件如果我在前一个页面里面做了一个form,并且把form的action设为download.jsp,那么也是会弹出文件下载对话框,并且点“保存”的时候是正常的,可是我点“打开”的时候,就会再次弹出一次文件保存对话框,然后再点“打开”,才会把图片打开,请问这是怎么回事?