• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Excel - IOException Invalid Header signature

 
Ranch Hand
Posts: 89
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a utility for export and import of data. I am saving a file in excel format and then importing the same file to the database.
When I try to import the same exported file, I get IOException - Invalid Header signature. But, if I first open the exported file in MS excel and then do - save as (in excel format) and then Import that saved file, I don't get the error.
I find out that when I export the file, it saves the file in text format only along with with .xls extention. The MS Excel converts the text file into Excel while reading. But the file exported is not actually an excel worksheet so the Import of the same file does not works.
Is there any solution to this problem. I am already using response.setContentType("application/vnd.ms-excel");

Thanks,
Nidhi
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of export and import code is that - do you have control over it (meaning, can you fix it)? If not, I'd talk to the vendor of whatever software you're using, and get a version that doesn't export a non-XLS file as XLS.
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic