• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xlsx file name problem in internet explorer

 
gendhe ranjith kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am using the following code to download xlsx file.


<%
String resultXLS="EIS Modules Installed_1008404_4.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8");
response.setHeader("content-disposition", "inline; filename=\"" + resultXLS + "\"");

File file = new File("/ed2/ora510/eld10comn/html/eisrs/EIS Modules Installed_1008404_4.xlsx");
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();

%>

when i click open in IE. the xlsx file name will change to jsp page name.

this will work fine in mozilla and chorme.


Thanks & Regards

Ranjith.
 
Ravi Majety
Ranch Hand
Posts: 59
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


change the above part as follows


 
gendhe ranjith kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

the provided solution did not solve problem.

it still showing the jsp name.

Thanks & regards

Ranjith.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic