I created an ".xlsx" file (CustomerData.xlsx) by using "Apache POI".
The problem is that the file is created on my TomCat Server and I have to download it.
I tried the following code, in order to download the file:
HttpServletResponse response = null;
response.setContentType("xlsx");
response.setHeader(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"attachment; filename=C:\CustomerData.xlsx");
try {
workbook.write(response.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but unfortunately, it does not seem to work.
In case you have any idea or suggestion, do not hesitate posting it.