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
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.