Re: [PHP] Downloading a file
- From: tomchubb@xxxxxxxxx ("Tom Chubb")
- Date: Wed, 16 Jul 2008 09:40:56 +0100
On 16/07/2008, Robbert van Andel <robbert@xxxxxxxxx> wrote:
Start here:
I am having trouble getting a file to download to work in Internet
Explorer.
The site works fine in FireFox. The page retrieves the contents of a file
from a database and outputs the following
<?PHP
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment;
filename=\"{$data['filename']}\"");
header("Content-Description: PHP Generated Data");
echo $data['file'];
?>
Where $data['filename'] is the name of the file as stored in the database
and $data['file'] is the contents of the file. The script used to download
the file is called view.php. As I mentioned, this works great in FireFox
but with Internet Explorer, I get the following error:
Internet Explorer cannot download view.php from www.yourdomain.com.
Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found. Please try again later.
Any help would be greatly appreciated.
Robbert
http://www.google.co.uk/search?source=ig&hl=en&rlz=&q=php+download+file+internet+explorer+headers&meta
=
- Follow-Ups:
- RE: [PHP] Downloading a file
- From: "Robbert van Andel"
- RE: [PHP] Downloading a file
- References:
- Downloading a file
- From: "Robbert van Andel"
- Downloading a file
- Prev by Date: Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
- Next by Date: Re: [PHP] How can i get the location of an exit()/die() from withinregister_shutdown_function()?
- Previous by thread: Downloading a file
- Next by thread: RE: [PHP] Downloading a file
- Index(es):
Relevant Pages
|