• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

error : upload excel file

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic