|
Posted by -Lost on 07/04/06 21:22
"darren" <groups@darrenludlam.plus.com> wrote in message
news:1152042641.253663.292910@m73g2000cwd.googlegroups.com...
> I have the following code that displays files and directoies within a
> directory and display the thumbnail exif data if it exists. And
> everybody was happy with that for a few hours.
>
> Now I have been asked to add a button that downloads the files in the
> directory and I can't quite get my head round it.
>
> Could someone point me in the right direction please.
The Zip (or Tar) PEAR package. Archive_Zip or Archive_Tar. If I am correct, File_Archive
is much better (I am guessing based on the fact it handles both ZIP and TAR and more).
Quick and dirty example...
/*
// Assuming PEAR directory is /something/
*/
include('Archive/Zip.php');
$zip = new Archive_Zip('all_the_files.zip');
$list = array('pic1.jpg', 'pic2.jpg'); // populate the array with your directory contents.
if ($zip->create($list))
{
print 'Your ZIP is ready.';
}
Then push the ZIP file to the browser using header (do not forget Content-Disposition).
Hope this helps.
-Lost
Navigation:
[Reply to this message]
|