ZipStream-PHP: The Native OSX-Unzipper can not handle the Archives.
I’m struggling to get correct archives that can be unzipped by the native OSX-Unzipper.
I’m reading and testing for some time now, but now I’m wondering if it is even possible for version >1. (I read several of these type of issues.)
- Can you confirm
->addFileFromStream()
does not work for the OSX-Unzipper? - If so, would it be wise to use version 0.5?
For a clear reference I’ll post the code that I used, and a test.zip file.
$options = new ZipStream\Option\Archive();
$options->setZeroHeader(true);
$options->setContentType( 'application/octet-stream' );
$options->setSendHttpHeaders(true);
$options->setHttpHeaderCallback('header');
$zip = new ZipStream\ZipStream( $filename . '.zip', $options );
foreach ( $files as $file ) {
if ( ! file_exists( $file ) ) {
continue;
}
if ( ! $stream = fopen( $file, 'r' ) ) {
$zip->addFileFromStream( basename( $file ), $stream );
} else {
die( __( 'Could not open stream for reading', 'photosessions' ) );
}
}
$zip->finish();
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Revert ZIP_VERSION_MADE_BY to its original value (#90) as it is causing some file permission issues on extracted files as discussed in #84 & #76 — committed to maennchen/ZipStream-PHP by deleted user 6 years ago
You’re telling me you don’t have a pile of mac’s lying around? ;p