Should I redirect after the reading of the file? This somehow does not make much sense ... I first need to let the user decide to download the file or not.
No, you should output a html page containing:
<a href="downloadzip.php?file=somefile.pdf">download</a>
Then, in downloadzip.php send the headers, build the zip and output it, don't send any html. Browser will prompt the user if he/she wants to save the file.
In fact you can output both html and other type of data b constructing multipart/mixed response, but it is left to the reader as an exercise :)
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php