You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Viva Chu <vi...@transplay.com> on 2003/08/28 07:39:30 UTC

Excel formats saved from web

Please find two Excel files attached: biotics_good.xls and biotics_bad.xls.
They contain the same data set but the binaries are different.  POI HSSF can
read the biotics_good.xls file, but generates the following IOException when
reading biotics_bad.xls:
java.io.IOException: Invalid header signature; read 8387989908914269500,
expected -2226271756974174256

at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java
:124)

at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:
120)

I saved the biotics_bad.xls file from a Java application that uses a
URLConnection to download the file from a website.  But I saved the
biotics_good.xls file via Internet Explorer:Save As "xls."

I am able to open biotics_bad.xls and save it an "XLS" file and this newly
saved version of the file can be read by POI.

Does anyone know what's going on here and how to save my XLS from my Java
application into a binary format that POI can understand?

Thanks,
Viva

        --------------------------------------------------
      Viva Chu
      Software Architect and Consultant
      vivachu@alumni.duke.edu
      510-895-0517
      --------------------------------------------------





RE: Excel formats saved from web

Posted by Viva Chu <vi...@transplay.com>.
Actually figured out what was going on here.  The web server returning the
spreadsheet was setting the mime type to the xls format but in actuality
returning an html file.  Oddly enough if you save the file with a .xls
extension, Windows saves it as a binary file.  However, if I simply change
the extension to be .html, it mystically transforms to a text file.

-----Original Message-----
From: Viva Chu [mailto:viva.chu@transplay.com]
Sent: Wednesday, August 27, 2003 10:40 PM
To: POI Users List
Subject: RE: Excel formats saved from web


I forgot the attachments...

-----Original Message-----
From: Viva Chu [mailto:viva.chu@transplay.com]
Sent: Wednesday, August 27, 2003 10:40 PM
To: poi-user@jakarta.apache.org
Subject: Excel formats saved from web


Please find two Excel files attached: biotics_good.xls and biotics_bad.xls.
They contain the same data set but the binaries are different.  POI HSSF can
read the biotics_good.xls file, but generates the following IOException when
reading biotics_bad.xls:
java.io.IOException: Invalid header signature; read 8387989908914269500,
expected -2226271756974174256

at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java
:124)

at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:
120)

I saved the biotics_bad.xls file from a Java application that uses a
URLConnection to download the file from a website.  But I saved the
biotics_good.xls file via Internet Explorer:Save As "xls."

I am able to open biotics_bad.xls and save it an "XLS" file and this newly
saved version of the file can be read by POI.

Does anyone know what's going on here and how to save my XLS from my Java
application into a binary format that POI can understand?

Thanks,
Viva

        --------------------------------------------------
      Viva Chu
      Software Architect and Consultant
      vivachu@alumni.duke.edu
      510-895-0517
      --------------------------------------------------






---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


RE: Excel formats saved from web

Posted by Viva Chu <vi...@transplay.com>.
I forgot the attachments...

-----Original Message-----
From: Viva Chu [mailto:viva.chu@transplay.com]
Sent: Wednesday, August 27, 2003 10:40 PM
To: poi-user@jakarta.apache.org
Subject: Excel formats saved from web


Please find two Excel files attached: biotics_good.xls and biotics_bad.xls.
They contain the same data set but the binaries are different.  POI HSSF can
read the biotics_good.xls file, but generates the following IOException when
reading biotics_bad.xls:
java.io.IOException: Invalid header signature; read 8387989908914269500,
expected -2226271756974174256

at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java
:124)

at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:
120)

I saved the biotics_bad.xls file from a Java application that uses a
URLConnection to download the file from a website.  But I saved the
biotics_good.xls file via Internet Explorer:Save As "xls."

I am able to open biotics_bad.xls and save it an "XLS" file and this newly
saved version of the file can be read by POI.

Does anyone know what's going on here and how to save my XLS from my Java
application into a binary format that POI can understand?

Thanks,
Viva

        --------------------------------------------------
      Viva Chu
      Software Architect and Consultant
      vivachu@alumni.duke.edu
      510-895-0517
      --------------------------------------------------