String contenttype = rs.getString("contentType");
String filename = rs.getString("fileName");
response.setContentType(contenttype);
response.setHeader("Content-disposition","attachment;filename=" + filename.replace('"', ' '));
java.io.InputStream instream = rs.getBinaryStream("fileData");
byte[] b = new byte[1000];
while (instream.read(b) > 0) {
try {
response.getOutputStream().write(b);
}
catch(Exception e) {}
}
try {
response.getOutputStream().flush();
}
catch(Exception e) {}
質問する
2684 次