Re: force to download file
| From: | Stephen Johnson | Date: | Mon, 17 Dec 2007 20:17:34 +0000 |
| Subject: | Re: force to download file | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44422@lists.php.net to get a copy of this message | ||
IE likes excel files, and wants to open them for you since it is such a
"helpful" application...
If you want to force the download you need to lie to the browser and claim
you are passing a file that it won't know what to do with.
You can try an exe header, but that will likely prompt security warnings
that will bug your users.
--
Stephen Johnson c | eh
The Lone Coder
http://www.thelonecoder.com
continuing the struggle against bad code
http://www.thumbnailresume.com
--
> From: Hiep Nguyen <hnguyen@jadesterling.com>
> Date: Mon, 17 Dec 2007 15:13:45 -0500
> To: <php-db@lists.php.net>
> Subject: [PHP-DB] force to download file
>
> hi all,
>
> i have this on top of my php page:
>
> header("Content-Type: application/vnd.ms-excel");
> header("Content-Disposition: inline; filename=excelfile.xls");
>
> but it is not prompt to save the file instead it opens right in IE.
>
> my question is how do i force the browser prompts to save the file?
>
> thanks