Re: Downloading movies / forcing download
| From: | Iv Ray | Date: | Tue, 27 May 2008 08:50:12 +0000 |
| Subject: | Re: Downloading movies / forcing download | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274720@lists.php.net to get a copy of this message | ||
A successful download across all browsers requires proper headers.
I do not have time to fix your code, but here are some suggestions, which for me do successful downloads regardless the browser -
header("Content-type: $mime");
/*
*
* This fixed the download in IE 7
*
* EXPLANATION
*
* Without this direct point to the URI * leads to attempt to download index.php, which leads to nothing.* */ header("Cache-Control: post-check=0, pre-check=0"); /* * * RFC 2183 * * Works on IE 7 and FF 1.5 * */ header("Content-Disposition: attachment; filename=\"$file\"; size=$size"); /* * * RFC 2183 * * No idea what it is good for. * */ header('Content-Description: download');