This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
for xlsx: The supplied data appears to be in the Office 2007+ XML..
You are calling the part of POI that deals with OLE2 Office Documents.
You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
for xls file its working fine.
can you please help me to handle these three types of file using HSSFWorkbook.
This has nothing to do with either the act of uploading files, nor with JSF. The reason is that apparently the code tries to open the file after uploading, and the library classes you're using (HSSF) simply can't handle XLSX files. The solution is to rewrite your code to handle both XLS and XLSX files by using the SS classes. This should help: http://poi.apache.org/spreadsheet/converting.html
Joined: Dec 05, 2012
Thank you Ulf,
Now I am able to manage xls and xlsx but I am not getting what to do for csv files.
could you please help me to get some idea.
Thanks and Regards,
Joined: Mar 22, 2005
What has the code previously been doing with CSV? I don't know what kind of support POI has for CSV; probably not much. But there are any number of libraries out there that can read CSVs. Given that it's a relatively simple format, those aren't hard to use.