Takamoto has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks. How can I unzip a docx file and read in memory the content of one member?
use Archive::Zip; my $InputFileReadable = 'text.docx'; my $zip = Archive::Zip->new(); $zip->read( $InputFileReadable ) == AZ_OK or die "Unable to open Offic +e file\n"; print my $wfh = $zip->extractMember( 'word/document.xml' );
$wfh does not contain anything. The following writes the xml to file correctly.
my $zip = Archive::Zip->new(); $zip->read( $InputFile ) == AZ_OK or die "Unable to open Office file\n +"; my $wfh = $zip->extractMember( 'word/document.xml', "word/document.xml +" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Archive::Zip into memory
by Corion (Patriarch) on Feb 12, 2023 at 17:16 UTC | |
|
Re: Archive::Zip into memory
by marto (Cardinal) on Feb 12, 2023 at 17:15 UTC | |
|
Re: Archive::Zip into memory
by alexander_lunev (Pilgrim) on Feb 12, 2023 at 18:10 UTC |