| 
 Posted by Paul F. Johnson on 05/23/06 01:02 
Hi, 
 
I'm trying to create a zip file from some pdfs and have code similar to this 
 
$id=$_GET['id']; 
$fn = array("a", "b", "c", "d"); 
chdir('../downloads'); // the php file is in /php 
$files = $fn[$id]."1.pdf ".$fn[$id]."2.pdf 7-17.pdf"; 
$command = "zip -9 " . $fn[$id] . ".zip " . $files; 
header("content-type:application/zip"); 
header("Content-disposition: attachment; filename=" . $fn[$id] . ".zip"); 
header("Pragma: no-cache"); 
header("Expires: 0"); 
shell_exec($command); 
 
The files do exist and a save as window appears, but the file generated is 0 
bytes long. I have tried changing the command to "/usr/bin/zip" 
and "//usr//bin//zip" and putting the shell_exec before the header lines as 
well changing shell_exec to exec and even just system. All the same result. 
 
Is there something I'm missing here? 
 
TTFN 
 
Paul
 
[Back to original message] 
 |