title: Generate multiple files, add them to a zip and then send the zip as a file download.
body: <p>I have a cfm page that generates multiple spreadsheet objects, right now if i try to send the files for download, only the last generated spreadsheet file is send as a download.</p>
  
  <p>Is there a way to write these files to a zip and send the zip file as a download? </p>
  
  <p>This is my existing logic:</p>
  
  <pre><code>for(VARIABLES.fileNumber = 0; VARIABLES.fileNumber  &lt; VARIABLES.maxFiles; VARIABLES.fileNumber = VARIABLES.fileNumber + 1)
  {
     /* code to create Spreadsheet here */
  
  
  
  
      VARIABLES.context = getPageContext();
      VARIABLES.context.setFlushOutput(true); 
  
      VARIABLES.response = VARIABLES.context.getResponse().getResponse();
      VARIABLES.response.reset();
      VARIABLES.response.setContentType("application/msexcel");   
      VARIABLES.response.setContentLength(len(SpreadsheetReadBinary(VARIABLES.suppItemSpreadSheetObj)));       
      VARIABLES.response.setHeader("Content-Disposition","attachment;filename=MyComplianceStatusFile#VARIABLES.fileNumber#Of#VARIABLES.maxFiles#.xls");
  
      VARIABLES.out = response.getOutputStream();     
      VARIABLES.out.write(SpreadsheetReadBinary(VARIABLES.suppItemSpreadSheetObj));       
  
  
      VARIABLES.out.flush();      
      VARIABLES.out.close();  
    }
  </code></pre>
  
  <p>Now , this way I get only the last spreadsheet that was generated. Is there a way to get all the spreadsheets that are generated may be one by one or may be in a zip ? </p>