You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/03/14 22:32:39 UTC
[Bug 35897] Password protected files
https://issues.apache.org/bugzilla/show_bug.cgi?id=35897
--- Comment #13 from ns <ni...@gmail.com> ---
Hi. I am getting org.apache.poi.hssf.record.RecordFormatException: Unknown
encryption info 4
when opening up this the attached file test1.xls
The thing is, if I use Excel (the UI itself) I and supply the password, it will
open. Or, if I resave it using a DIFFERENT password in Excel, it will open.
I am thinking this file (sent to me) was created by a non-Excel program,
probably some other library. But if Excel can open it, why can POI? I am
guessing it is an encryption type (what is type 4?)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [Bug 35897] Password protected files
Posted by vishal_sinha <vi...@adeptia.com>.
data.xls <http://apache-poi.1045710.n5.nabble.com/file/n5716738/data.xls>
Hello,
I am creating a password protected file of format Excel 97-2003 Workbook
(.xls) using Microsoft Office 2013.
I have written a java program to read password protected excel file using
POI API. I am able to read .xlsx file using this API, but I am not able to
read .xls file. It throws error :
org.apache.poi.hssf.record.RecordFormatException: Unknown encryption info 4
at org.apache.poi.hssf.record.FilePassRecord.<init>(FilePassRecord.java:70)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:87)
at
org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:338)
at
org.apache.poi.hssf.record.RecordFactoryInputStream$StreamEncryptionInfo.<init>(RecordFactoryInputStream.java:73)
at
org.apache.poi.hssf.record.RecordFactoryInputStream.<init>(RecordFactoryInputStream.java:182)
at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:477)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:301)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:264)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:199)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:342)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:323)
Using same java code I am able to read .xls file if I use Microsoft Office
2010 to create this password protected file.
My OS is Windows 8(64-bit).
I am using latest Apache POI API i.e. “poi-3.10.1-20140818.jar”.
Can you please let me know how I can solve this issue. I have attached XLS
file for reference.
Thanks
Vishal
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Bug-35897-Password-protected-files-tp5715183p5716738.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org