Monday, April 16

ZipArchive

Man, I'm trying to get this to work, but I'm not having any luck at all. It's driving me nuts!!

I'll post a solution when I get it. I've got my WIMP with php 5.2.1 and zlib 1.2.3, using the sample code from php.net

It's supposed to create a file called test112.zip, but instead I'm ending up with test112.zip.a03600 and another one called test112.zip.b03600. It's time to go home now, but I'll figure this out tomorrow.

--------------------------------------------------
Well, I'm still working on this. I'm super confused because I'm still ending up with those temporary files. I moved the script to an area where I know IUSR_SERVERNAME is allowed write permissions, but that didn't help.

I tried making .gz files just in case zlib really doesn't work with .zip, but those didn't work either.

If I use AddFromString, I can rename the files ending in zip.a03600 (or whatever number it happens to be) and then I can extract it, which is saying to me a rename error. BUT, if I use AddFile instead, no files are added and the zip isn't even created.

I tried going through the list of errors and seeing which ones I get, but it ends up being most of them. I couldn't find a way to have it report which error it's getting, so I wrote a bunch of ifs. Turns out that wasn't the best option, since all but ZipArchive::ER_OK resulted in true.

I'm still workin on it, but interrupted by people who can't print.... ._.

No comments: