https://bz.apache.org/bugzilla/show_bug.cgi?id=64473
Bug ID: 64473
Summary: OPCPackage.open(fileName, PackageAccess.READ) does not
open valid xlsx file
Product: POI
Version: 4.1.2-FINAL
Hardware: PC
Status: NEW
Severity: blocker
Priority: P2
Component: OPC
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 37268
--> https://bz.apache.org/bugzilla/attachment.cgi?id=37268&action=edit
corrupted file
Contents of the unpacked xlsx file and apache poi
The initial problem is the inability to open the xlsx file through poi
(OPCPackage.open(fileName, PackageAccess.READ)), while in Excel it opens.
A detailed study of the poi showed that the problem lies in the contents of the
xlsx file.
If you unzip xslx file, then in the xl folder, in addition to all other files
there will be two due to which there is a problem
xl/metadata
xl/metadata.xml
when using poi method OPCPackage.open(fileName, PackageAccess.READ) this leads
to an error:
org.apache.poi.openxml4j.exceptions.InvalidFormatException: You can't add a
part with a part name derived from another part ! [M1.11]
which occurs due to the same file names in PackagePartCollection.put method.
If I just copy the contents of the entire xlsx file to a new created xlsx file
and save it, then the xl/metadata file will not be there and it will open
through poi well.
But I don’t have the task of just fixing the file, I need to figure out why
this problem could arise.
it looks like a slightly incorrect xlsx, but I can still open it through exel,
is there any way to open it through poi?
Is there any idea about the occurrence of xl/metadata in the contents of the
xlsx?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]