title: How would I enable users to download an excel file which is created on the server
body: <p>I am able to create the excel file using apache poi but how would I enable the users to download the excel file which would be created on the server?</p>
  
  <pre><code>public String export(UserDetails user) throws Exception {
      HSSFWorkbook wb = new HSSFWorkbook();
      HSSFSheet sheet = wb.createSheet("new sheet");
      List&lt;UserDetails&gt; lstUserDetail = getUserDetailList();
  
      for (short RowNum=1; RowNum&lt;lstUserDetail.size();RowNum++){
          HSSFRow row = sheet.createRow(RowNum);
          UserDetails userDetail = lstUserDetail.get(RowNum);
  
          HSSFCell cell1 = row.createCell((short)0);
          HSSFCell cell2 = row.createCell((short)1);
          HSSFCell cell3 = row.createCell((short)2);
          HSSFCell cell4 = row.createCell((short)3);
  
          cell2.setCellValue(userDetail.getStrUserName());
          cell3.setCellValue(userDetail.getStrEMail());
          cell4.setCellValue(userDetail.getStrUserPhone());
          cell5.setCellValue(userDetail.getStrUserAddress());
      }
  
      FileOutputStream fileOut = new FileOutputStream("E:\\workbook.xls");
      wb.write(fileOut);
      fileOut.close();
  
      return null;
  }
  </code></pre>