-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
NPOI Version Used
2.7.5
File Type
- XLSX
- XLS
- DOCX
- XLSM
- OTHER
Use Case
Sometimes files are password protected and we get an exception trying to open it:
ICSharpCode.SharpZipLib.Zip.ZipException: EOF in header
at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadLeByte()
at ICSharpCode.SharpZipLib.Zip.ZipInputStream.SkipUntilNextEntry()
at ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry()
at NPOI.OpenXml4Net.Util.ZipInputStreamZipEntrySource..ctor(ZipInputStream inp)
at NPOI.OpenXml4Net.OPC.ZipPackage..ctor(Stream in1, PackageAccess access)
at NPOI.OpenXml4Net.OPC.OPCPackage.Open(Stream stream, Boolean readOnly)
at NPOI.Util.PackageHelper.Open(Stream stream, Boolean readOnly)
at NPOI.XWPF.UserModel.XWPFDocument..ctor(Stream is1)
Description
It would be nice to have at least a meaningful exception thrown or a way to check that file is protected.