Re: Question on manually instantiating a file download

From: Date: Tue, 27 Mar 2001 19:11:20 +0000
Subject: Re: Question on manually instantiating a file download
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45762@lists.php.net to get a copy of this message
hello, you could "start from the end" :) show the nice page saying "THANKS!!" or something and this page will call the download script itself with "meta refresh=..." in the <head> ...can't remember the meta refresh syntax right now :) hope it works, Nuno Vikram Vaswani wrote:
Hello all, I am working on a script which locates a file on the system and then tells the browser to pop open the "Save As" dialog box for download. In order to do this, I am using the following code: $filename = $dataDir . $id . ".dat"; header ("Content-Type: application/octet-stream"); header ("Content-Disposition: attachment; filename=$filename"); readfile($filename); This works fine - however, I would like to redirect the browser to another page once the download is complete (or once it starts). I have tried adding a header("Location:next.php") line to the end of the script above, but it has no effect whatsoever (after the download is complete, the browser displays an hourglass as though waiting for something). Do I need to send some kind of "end-of-download" header...or something else? Can anyone suggest some possible solutions to this problem? Please CC a copy of your response to bacchus@vsnl.com as well as the list (as I will be working on this @ home also and do not have access to the full digest there) Any help will be much appreciated. TIA, Vikram Vaswani -- Sex is like air. It's only a big deal if you can't get any.


« previous php.general (#45762) next »