Reply to using shell_exec question

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация