res.setStatus(res.SC_OK);
res.setContentType("application/octet-stream");
res.setHeader("Content-Disposition", "attachment; filename=" + file.getName());
res.setContentLength((int)file.length());
BufferedOutputStream bos=new BufferedOutputStream(res.getOutputStream());
BufferedInputStream bis=new BufferedInputStream(new FileInputStream(file));
byte[] buf=new byte[32768];//do it in large chunks, it's quicker
int bytesRead;
while((bytesRead=bis.read(buf,0,buf.length))!=-1) {
bos.write(buf,0,bytesRead);
}
bos.close();
bis.close();
saveInfo(downloadForm); //save the details in the database
forward=mapping.findForward("success");
John
============================================= John Moore - Norwich, UK - [EMAIL PROTECTED] =============================================
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]