Re: How to manipulate headers

From: Date: Mon, 19 Dec 2005 18:24:49 +0000
Subject: Re: How to manipulate headers
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22311@lists.php.net to get a copy of this message
On 12/18/05, Alejandro López Hernández <alopez@ulfix.net> wrote: > Hello guys, > > I'm using HTTP_Download in order to send hidden files, it's working fine > as long as I don't send header information before launching the file, is > it possible to launch a donwload after I have sent headers? > > This is the code I'm using: > > <?php > require_once 'HTTP/Download.php'; > $dl = new HTTP_Download(array('file'=>'/home/finatrade/installer.exe', > 'contenttype'=>'application/octet-stream', > 'contentdisposition'=> HTTP_DOWNLOAD_INLINE) > ); > $dl->send(); > ?> > > It works great if I don't sent any other information before it, how can I > manipulate this so that I can launch the file after I have sent something else like > html code. > You can only get one thing at once from a single request. A web page or a file, not both. Yo could easily put a meta refresh in your html page to send the browser to a download script which would then send the file. This is what the big download sites do (download.com, sf.net, etc). -- Justin Patrin

« previous php.pear.general (#22311) next »