Re: HTML in Download data?

From: Date: Fri, 24 Sep 2004 15:58:32 +0000
Subject: Re: HTML in Download data?
Groups: php.general 
Request: Send a blank email to php-general+get-197787@lists.php.net to get a copy of this message
Thomas Hochstetter wrote:
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 :)

« previous php.general (#197787) next »