hi
i am using the following code to download xlsx file from server.
<%
String resultXLS="file downloading from jsp.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8");
response.setHeader("content-disposition", "attachment; filename=\"" + resultXLS + "\"");
File file = new File(filepath);
FileInputStream fileIn = new FileInputStream(file);
OutputStream outExcel = response.getOutputStream();
byte[] outputByte = new byte[8192];
//copy binary contect to output stream
while(fileIn.read(outputByte, 0, 8192) != -1)
{
outExcel.write(outputByte, 0, 8192);
}
fileIn.close();
outExcel.flush();
outExcel.close();
%>
the file generated. but i am getting some error messages.
1."excel found unreadable content. do you want to recover from it".
2."the file cannot opened by Microsoft excel . do you want to search on online for converter to open the file".
any help on this will be appreciated.
Thanks & regards
Ranjith