GeeCON Prague 2014*
The moose likes JSP and the fly likes xlsx file name problem in internet explorer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "xlsx file name problem in internet explorer" Watch "xlsx file name problem in internet explorer" New topic
Author

xlsx file name problem in internet explorer

gendhe ranjith kumar
Greenhorn

Joined: Mar 28, 2011
Posts: 20
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

Joined: Feb 26, 2009
Posts: 59



change the above part as follows


gendhe ranjith kumar
Greenhorn

Joined: Mar 28, 2011
Posts: 20
hi

the provided solution did not solve problem.

it still showing the jsp name.

Thanks & regards

Ranjith.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xlsx file name problem in internet explorer