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
Description In the following example code, the program throws an exception at $zip->openFiile() after 2nd iteration of the for loop.
How to reproduce
function testZip() { // path to empty zip file $zipFilePath = 'path/to/zipfile';
for ($i=0; $i<20; $i++) { $zip = new \PhpZip\ZipFile(); if ($zip->openFile($zipFilePath)) { $fileContents = file_get_contents('example.txt'); $zip->addFromString('example' . strval($i) . '.txt', $fileContents); $zip->saveAsFile($zipFilePath); $zip->close(); } }
}
Additional context Error Message: Exception: example0.txt (expected Local File Header)
Stack Trace:
File: ../vendor/nelexa/zip/src/IO/ZipReader.php Line: 615 Trace: #0 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(515): PhpZip\IO\ZipReader->loadLocalExtraFields(Object(PhpZip\Model\ZipEntry)) #1 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(363): PhpZip\IO\ZipReader->readZipEntry(Resource id #69) #2 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(117): PhpZip\IO\ZipReader->readCentralDirectory(Object(PhpZip\Model\EndOfCentralDirectory)) #3 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/ZipFile.php(152): PhpZip\IO\ZipReader->read() #4 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/ZipFile.php(113): PhpZip\ZipFile->openFromStream(Resource id #68, Array)
The text was updated successfully, but these errors were encountered:
I have tried to reproduce this problem on my computer and can say that this is not the case.
The error message indicates that your "original" ZIP file may be "corrupted".
Sorry, something went wrong.
No branches or pull requests
Description
In the following example code, the program throws an exception at $zip->openFiile() after 2nd iteration of the for loop.
How to reproduce
function testZip() {
// path to empty zip file
$zipFilePath = 'path/to/zipfile';
}
Additional context
Error Message: Exception: example0.txt (expected Local File Header)
Stack Trace:
File: ../vendor/nelexa/zip/src/IO/ZipReader.php
Line: 615
Trace:
#0 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(515): PhpZip\IO\ZipReader->loadLocalExtraFields(Object(PhpZip\Model\ZipEntry))
#1 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(363): PhpZip\IO\ZipReader->readZipEntry(Resource id #69)
#2 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/IO/ZipReader.php(117): PhpZip\IO\ZipReader->readCentralDirectory(Object(PhpZip\Model\EndOfCentralDirectory))
#3 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/ZipFile.php(152): PhpZip\IO\ZipReader->read()
#4 /home/site/wwwroot/wp-content/plugins/azure_app_service_migration/vendor/nelexa/zip/src/ZipFile.php(113): PhpZip\ZipFile->openFromStream(Resource id #68, Array)
The text was updated successfully, but these errors were encountered: