This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes error : upload excel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "error : upload excel file" Watch "error : upload excel file" New topic
Author

error : upload excel file

Rajni Patel
Ranch Hand

Joined: Sep 03, 2009
Posts: 84
Hi,

I want to upload excel file using struts1.

In my action class below code I have written,

Error is coming on line
fileSystem = new POIFSFileSystem(fs);

java.io.IOException: Invalid header signature; read 63361219987247567, expected
-2226271756974174256

I have find from some forum, because of Excel file format error is coming.

I have excel 2003 and just I create 2 rows and 2 column, simple excel file.

Please, could anybody can tell me , what's the problem?

thanks,
Radovan Vukovic
Greenhorn

Joined: Nov 03, 2010
Posts: 19
This error coming probably from your file, could be that is corrupted?

Or (I did not work with version after 3.5) i know that this version did not support excel autofilter. Can be that this is in your file?
Rajni Patel
Ranch Hand

Joined: Sep 03, 2009
Posts: 84
just I did entry in 2 row & 2 column like name and no. and I close the file.
I have Excel 2003.

Please, Give me some suggestion.

Thanks
Radovan Vukovic
Greenhorn

Joined: Nov 03, 2010
Posts: 19
Why you are using POIFSFileSystem?
Only to create HSSFWorkbook?

If this is only reason then you can try and create HSSFWorkbook directly from InputStream

Check please
Rajni Patel
Ranch Hand

Joined: Sep 03, 2009
Posts: 84
Thanks for reply.

My intense is to read excel file, and insert into database. I have change in my code. but still same error is coming.

Invalid header.



please guide me.

Thanks
Rajni Patel
Ranch Hand

Joined: Sep 03, 2009
Posts: 84
I print message of getContenttype() for excel file. What it should come?
getContentType() = application/octet-stream or
getContentType() = application/vnd.ms-excel
Is it necessary t any fix contenttype?

thanks,
 
wood burning stoves
 
subject: error : upload excel file