[thelist] Zip files on server (PHP / Linux)
deboute benjamin
deboute at fr.clara.net
Thu Jan 25 20:20:31 CST 2001
At 18:22 25/01/2001 +0000, you wrote:
>I am trying to zip up a directory of files server side using PHP on a Linux
>platform.
>
>How would I go about doing this?
tar or zip [with zip or gzip]
think of your current directory
chdir('/where/i/put/the/zip')
$tar_command="tar --create -z --file=archive.tar.gz";
$zip_command="zip -n archive";
$directory_handle=opendir("$DOCUMENT_ROOT/path/to/".$directory);
while($file = readdir($handle)){
($file != "." && $file != "..")?$filelist.=" ".$file:false;
}
$filelist.=" *.gif";
//*.extension takes all files of this extension
$tar_command.=$filelist;
$zip_command.=$filelist;
`$tar_command`;
`$zip_command`;
More information about the thelist
mailing list