Click to See Complete Forum and Search --> : best way to compress download on Windows


azazel
01-05-2004, 05:45 PM
hi!

i'm writing an application for the web that provides an interface for users to select files from a database to download.

what is the best way to compress many files into one archive and then download it to the user on a Windows server?

i have it working on a unix server. just using exec() to run gzip. but... sadly, Windows doesn't look as straight forward.

any help is much appreciated! thanks in advance. :)

pyro
01-05-2004, 06:53 PM
Never done it, but have you looked at Archive_Zip PEAR class? http://pear.php.net/package/Archive_Zip

Or, http://us4.php.net/manual/en/ref.zip.php, if you'd like to do it yourself.

azazel
01-06-2004, 07:00 PM
thanks! although, it looks like the PEAR zip thing doesn't have any releases yet.
and zlib only works for .gz, which AFAIK only works on unix. am i wrong?

i have a bunch of separate files on the webserver which i need to dynamically compress into a Windows readable zip file.

here's the process:

a user comes to the web application i'm building, and selects which files he wants to download from a list. then, the program should take those files (using paths from the database) and compress them all into one file. the point of one file is more for just ease-of-use rather than actual size issues. in other words, i basically want the user to be able to just download a bunch of files at one time, as if they were in a folder. is this making more sense? :)

so, here's one question: if i install something like PKZip on my Windows server, can i use exec() to do this?

thanks again!