response.setContentType("multipart/zip");
response.setHeader("Content-Disposition",
"attachment; filename=\"" +
filename.trim().substring(1,filename.length()) + "\";");
response.setContentLength((int)f.length());
try
{
OutputStream os = response.getOutputStream();
FileInputStream stream = new FileInputStream(f);
BufferedInputStream bis = new BufferedInputStream(stream);
InputStream is = new BufferedInputStream(bis);
int count;
byte buf[] = new byte[4096];
while ((count = is.read(buf)) > -1)
{
os.write(buf, 0, count);
}
is.close();
os.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}
..
return mapping.findforward("fichieenvoye");