Ne-Lexa / php-zip

PhpZip is a php-library for extended work with ZIP-archives.
MIT License
491 stars 60 forks source link

Zip64 String #77

Closed semihaksu closed 3 years ago

semihaksu commented 3 years ago

I don't understand, how can I create Zip64 String output. $content = 'test'; $zipFile = new \PhpZip\ZipFile(); $zipFile->addFromString('Msg', $content); $zipFile->setCompressionMethodEntry('Msg', \PhpZip\Constants\ZipCompressionMethod::DEFLATED); $zipFile->setCompressionLevel(\PhpZip\Constants\ZipCompressionLevel::MAXIMUM); $zipFile->setCompressionLevelEntry('Msg', \PhpZip\Constants\ZipCompressionLevel::MAXIMUM); $rawZipArchiveBytes = $zipFile->outputAsString(); echo base64_encode($rawZipArchiveBytes); $zipFile->close();

my code example like below. but It gives me zip not zip64

Ne-Lexa commented 3 years ago

ZIP64 is not base64 encoding, but a zip format extension to support files larger than 4GB or more than 65536 files in an archive.

semihaksu commented 3 years ago

base64 encoding is irrelevant :) thats the output format which I used. Main question is if I use ZIP64 for files less than 4gb?

Ne-Lexa commented 3 years ago

Not. It doesn't make sense. Technically, this can be done by adding Zip64ExtraField to extra fields.