Realtime Zipping of folders for webserver?

supernancy

Senior member
Dec 20, 1999
233
0
0
Itunes organized my mp3 library.

I want to make the mp3 folders easy to download in my webserver.

Here is what I'd like to do:
-Show a user the list of folders available:
Artist1
Artist2
Artist3

By clicking on these folders (or a link beside it), a temporary zip file will be made, then downloaded to them.. then deleted.

I know Apache has a MOD_GZIP option and I know UNIX clients have the ability to gzip/tar/bzip files in a dir and offer then to be downloaded...
but how to do this in windows?

Perhaps some sort of PHP shell script to run- for example:
<a href=dozip.php?folder=artist1>Artist1</a>
Where dozip.php would contain something like:
<?php
exec (zip c:\mp3\artist1\ artist1.zip);
// Set some sort of server parameter with the filename: artist1.zip
// And command the server to delete the file after X amt of minutes
// I'd use a cronjob every X minutes to delete the 'temp' files,
// but I'm not running this on *nix/linux.
?>
Allow the file to be downloaded
Wait X amount of minutes and delete the file.

Is there a better way to do this?