You are not logged in.
Pages: 1
I have a large amount of files in a given folder. I would like to do the following.
1) zip up files or folder if its easier
2) "pipe" the output of the zip file to the user as a download link
thats it. I dont want to zip file to be stored on the server. The file will be to big.
i know how to make a zip file
<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFile($thisdir ."./file01.txt");
$zip->addFile($thisdir ."./file02.txt");
$zip->addFile($thisdir ."./file03.txt");
$zip->close();
?>
I just dont know how exactly to send the output to the user as it is being compressed.
Offline
Pages: 1