What\'s the easiest way to zip, say 2 files, from a folder on the server and force download? Without saving the \"zip\" to the server.
$zip = new ZipArc
Your code is very close. You need to use the file name instead of the file contents.
$zip->addFile(file_get_contents($filepath1), 'file1');
should be
$zip->addFile($filepath1, 'file1');
http://us3.php.net/manual/en/function.ziparchive-addfile.php
If you need to add files from a variable instead of a file you can use the addFromString function.
$zip->addFromString( 'file1', $data );