re: File Download IE behavior
| From: | Bill Rausch | Date: | Wed, 11 Jul 2001 18:43:13 +0000 |
| Subject: | re: File Download IE behavior | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-57467@lists.php.net to get a copy of this message | ||
"Warren Vail" <warren@availabletech.com> said:
When generating a download file from PHP to IE (Netscape is not used by my client base) the browser prompts with an option to download the file or open the file where it is. Opening the file fails and I am forced to download the file to my local drive before receiving another prompt to open the file where the second Open works just fine. Is there a way to allow this first open to work, or cause the open option on the first download window to be removed?I've spent time fiddled with this stuff a few months ago and came up with the following. The basic sequence of commands that I use is that I use look like: $x = array(); $x = stat( "simple.pdf" ); header( "Content-Length: " . $x[7] ); ^ header( "Accept-Ranges: bytes" ); header( "Connection: close" ); header( "Content-Type: application/pdf" ); readfile( "simple.pdf" ); Also, a php.ini setting of interest is: session.cache_limiter = Depending on SSL, cookies, and other things you might need to set this to either nothing at all or to public. -- Bill Rausch, Software Development, Unix, Mac, Windows Numerical Applications, Inc. 509-943-0861 bill@numerical.com