> response.setContentType("application/zip");
> response.setHeader("Content-Disposition", "attachment; filename=" +
> zipFileName);
> response.setContentLength((int)tempCSVFile.length());
> BufferedInputStream bufferedInput = new BufferedInputStream(new
> FileInputStream(tempCSVFile));
> BufferedOutputStream bufferedOutput = new BufferedOutputStream(
> response.getOutputStream());
>
> while((leftToRead = bufferedInput.read(buffer)) != -1) {
> bufferedOutput.write(buffer, 0, leftToRead);
> }
>
> bufferedInput.close();
> bufferedOutput.flush();
> bufferedOutput.close ();
>
> if(!errors.isEmpty()) {
> saveErrors(request, errors);
> return(mapping.findForward("fail"));
> }
>
> return (mapping.findForward("success"));


I don't think it's anything to do with Struts. You just set the
content-length header, which tells the servlet container how much the
response body length would be. If you try to write more stuff into it, I'm
not sure it would get written to the response.

Reply via email to