Well, what kind of interaction with the zip functionality will the user need to have? I was under the impression that they would upload the files to the server, and then the server would zip them up....
[Resolved] Creating .zip files
ko - i was messing around with zips a few weeks ago myself.i figured it all out pretty well - EXCEPT how to ADD files to an existing zip archive. ive also tried some open source scripts - but no luck... id be happy about any ideas.
What program are you using for zips sid?
I haven't done much playing around with these before, but it seems to be fairly uncharted territory....I'll have to start playing...
ill post it tomorrow - i'm ot on my main machine and cant think of the names right now - though the one mentioned earlier (PclZip) was one of them if i recall that correctly (i know one of them was french)
Well, I've played around with a couple of them....
WinZip's annoying. The non-licensed version makes you manually close the command window, saying "Buy our product to not have to do this".
WinRAR's my fav. It's got massive amounts of options on the command line. So many that I only got through some of the basics before moving on, but again, it's also not free.
Of the couple free ones, they're all pretty basic as far as command line goes. -a for add, -r for recursive, -d for delete, and so on. So, I'm wondering, which one does everyone think would be best? I'm thinking that whichever one is the better, I'll start trying to get some easy-to-implement functions done, and maybe put those up in the code crituqe forum for people to rip apart. So....what do you guys think?
Maybe I'm wrong to assume this, but most people can open .zip files, right? I want to go with the kind of archive anybody can open.
Originally posted by LordShryku
Well, what kind of interaction with the zip functionality will the user need to have? I was under the impression that they would upload the files to the server, and then the server would zip them up....
Yes, that's exactly what I wanted to do, and I realise that my above question was quite stupid... I still haven't got around to trying PclZip...in a few days...as I said, good thing I know French...
PHPMyAdmin has a class for creating zip files that is pretty easy to use. Download the source and the class is in its own file. Its a LOT easier than trying to figure out some other classes or writing your own. I figured the class out in <30 minutes.
PclZip is the class I will use...once I've tested I will resolve this thread.
shell_exec('cd /home/vhost/site1.com/html/
tar cf -directory | gzip -9 > directory.tar.gz
mv directory.tar.gz /home/vhost/site2.com/html/directory.tar.gz');
ok it's not a zip, creating one of those on the fly is a job beyond me but i get an acceptable result with the above.
i wanted zips but was happy to settle for this. i just use it to bundle up content from one site on our server to another which makes it easy for clients to download stuff.
The real trick is making it cross-OS compatible. Never tried doing this with a compression other than tar. Though, I'm sure small gunzip executables exist also.
well if it's a *nix server it'll probably have zip/unzip installed, right? just run a pass through that, i was playing with it earlier, it'd not hard to use. "zip -r [archive] [directory]/" will do a recursive save, just remember not to add the .zip bit to [archive] (odd i know)
as for windows, who cares? but really there aren't too many hosts running windows that'll want a PHP script from what i've seen... but then PHP's supposed to be ahead of CF on windows servers, so what do i know?
hth
moon
Even better, provide the GNU WIN32 port of whatever compression you want to use with the script. Cross compatible with the same code
That's all very well and good but I'm using Windows...(slap me)
It should be cross-OS compatible, and will be...well...at least for Windows and Linux.
Originally posted by Merve
(slap me)
consider yourself slapped
Hey, come summer, I'm reformatting the disk on my old machine and installing Icepack Linux on that.
Testing right now...
PclZip worked like a charm. Thanks for your help on this issue.