Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Corrupted file not getting fed to POI

Ranch Hand
Posts: 254
MySQL Database Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using POI 3.9 to read Excel files in my Java application. I'm exporting some tables from MySQL query browser for filling it with data to match the table columns.

When I open this file a dialog pops up giving the warning: 'The file xyz.xls is in a different format....' but does open on clicking OK. At the same time this file is also refused by the Java application giving the following reason:

Also note that I am using the factory method which handles the loading of desired file (.xls and .xlsx) if my understanding is right. This is how I pass the File as an InputStream.

But the file is accepted by POI once I save it as a .xlsx file. So my question is,

1) How do I prevent Query Browser corrupting the file (if it is) ?
2) The sheet will be loaded by the end user and the person will be inconvenienced always saving it to .xlsx. How do I avoid this assuming it is not a user-friendly way?
I am a man of mystery. Mostly because of this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!