Jump to content

ZipArchive usage on linux


drewdall

Recommended Posts

Hello All,

 

I've developed a script (using ZipArchive, calling addFile etc) to create a zip file on my little Windows server running xampp. Everything fine, I get a file called harry.zip, albeit a largish 130MB.

 

But when I port the script to a linux (debian 5.2.6) machine, and use it to generate a zip from exactly the same set of files, the script produces 2 files, of the form harry.zip.XXXXXX, where XXXXXX is a seemingly random set of six alphanumerics. Both files are over 100MB each! When I download these file to my Windows pc, 7Zip is unable to read them.

 

Why are 2 files produced, and why the funny extension? What am I doing wrong, and can anybody tell me how to do it right, so that on linux I end up with a single zip?

 

Thank you for your time and attention. Regards.

 

Link to comment
https://forums.phpfreaks.com/topic/201614-ziparchive-usage-on-linux/
Share on other sites

Just been reading up a bit more and found out about ZipArchive::addFile() bug which imposes a limit on the number of files you can add to an archive, the workaround being to close/reopen the archive to continue adding more files, which I now do every 100 files and it's fixed it, inasmuch as I now get a complete, single zip file. The only remaining issue is that the process leaves one of those intermediate harry.zip.XXXXXX files hanging around, but I guess I can live with that. Cheers!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.