poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avik Sengupta <a...@apache.org>
Subject Re: Error occurred: Invalid header signature; read 3255307777713450495, expected -2226271756974174256
Date Wed, 08 Oct 2003 04:29:06 GMT
While I dont know whats the context of your code, and so cant be sure,
but i think your solution is too trivial. An http request contains many
different things. You CANNOT just pass it to any app and expect a well
formed file stream to emerge! Use a proper utility to retrieve the file
from the request. Search google for a servlet based file upload utility.

On Tue, 2003-10-07 at 19:10, Dhanore, Prakash (SUPP) wrote:
> Hi,
> I am trying to upload the excel file and I am getting error below. One of the FAQ says
that I have to remove the header information from the HTTPRequest object but I am not sure
how to remove that. I am using weblogic 6.1.
> This is the code generating this error:
>           InputStream fin = request.getInputStream();
>           BlockingInputStream bis = new BlockingInputStream(fin);
>           ByteArrayOutputStream baos = new ByteArrayOutputStream();
>           int ch= -1;
>           baos.write(ch);  
>           while ((ch=bis.read()) > -1){
>             baos.write(ch);
>           }
>           byte[] inputBytes = baos.toByteArray();
>           POIFSFileSystem fs= new POIFSFileSystem(new ByteArrayInputStream(inputBytes));
>           HSSFWorkbook wb = new HSSFWorkbook(request.getInputStream());
> Error occurred: Invalid header signature; read 3255307777713450495, expected -2226271756974174256

> 
> Thanks,
> Prakash
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-dev-help@jakarta.apache.org



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


Mime
View raw message