We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a problem where Madzipper cannot read the files from an archive I create during a test, whereas when using native ZipArchive there is no issue.
I am currently using PHP 8.3 together with Laravel v.10.39 and the latest Madzipper.
Creates an empty directory:
$zipper = \Madzipper::make($extractSourcePath); $zipper->extractTo($extractTargetPath); $zipper->close();
Creates directory as expected containing all the files from the archive:
$zipArchive = new \ZipArchive; $zipArchive->open($extractSourcePath); $zipArchive->extractTo($extractTargetPath); $zipArchive->close();
It doesn't matter if I am just using extractTo or listFiles, it just cannot read the contents. listFiles will return [] accordingly.
extractTo
listFiles
[]
The common test code is:
$response = $this->get(route('batch.zip.download', [ 'task_files' => $inputTaskFiles->implode('id', ',') ])); $response->assertStatus(200); $response->assertDownload(); $fileName = 'task_batch'; $sourceFileName = "{$fileName}.zip"; $this->getTestStorageDisk()->put( $sourceFileName, $response->streamedContent() ); $extractSourcePath = $this->getTestStorageDisk()->path($sourceFileName); $extractTargetPath = $this->getTestStorageDisk()->path($fileName);
The controller code uses the ZipStream package:
return response()->streamDownload(function () use ($request, $name) { $zip = new ZipStream( outputName: $name, // enable output of HTTP headers sendHttpHeaders: true ); // Add files to archive $zip->finish(); return $zip; }, $name, [ 'Content-Type' => 'application/zip', ]);
I don't think it even matters how the archive is created, we can assume it's there and not empty.
Maybe someone can help to find out why this happens.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a problem where Madzipper cannot read the files from an archive I create during a test, whereas when using native ZipArchive there is no issue.
I am currently using PHP 8.3 together with Laravel v.10.39 and the latest Madzipper.
Creates an empty directory:
Creates directory as expected containing all the files from the archive:
It doesn't matter if I am just using
extractTo
orlistFiles
, it just cannot read the contents.listFiles
will return[]
accordingly.The common test code is:
The controller code uses the ZipStream package:
I don't think it even matters how the archive is created, we can assume it's there and not empty.
Maybe someone can help to find out why this happens.
The text was updated successfully, but these errors were encountered: