wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Junk characters while reading excel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Junk characters while reading excel file" Watch "Junk characters while reading excel file" New topic

Junk characters while reading excel file

Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
Hi All,
I am using the following code to read an excel file using jsp/Weblogic 8.1 I have already set MIME type in weblogic. Still, it gives junk characters.

Any suggestions ???

Here is the code:
<%@ page import="java.util.*,java.io.* "%>
String fileNameWithPath = "C:\\test.xls";
FileInputStream fileStream = new FileInputStream (fileNameWithPath);
intnumberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream sout = response.getOutputStream();

response.setHeader("Content-Disposition","inline; filename=\"" + "MyFile" + "\";");
sout.write (contents);
sout.flush ();

Thanks in advance

Cheers !!

I agree. Here's the link: http://aspose.com/file-tools
subject: Junk characters while reading excel file
Similar Threads
Trying to download an excel through JSP
Exporting 2 byte character data from jsp to excel
Open excel in JSP
Junk characters while reading an excel file
Opening Excel in IE throws junk characters