[thelist] Blank messages ?
Andy Warwick
mailing.lists at creed.co.uk
Sun Aug 11 15:48:23 CDT 2002
Apologies for the off topic post, but I've paid with a tip...
Is anyone else getting blank messages from the list along with the normal
traffic?
The latest example was sent at 2002/08/11 09:28 pm, and had a blank subject
line, no readable internet headers and the text:
> Sincerely,
> Kid Stevens
>
> "Reading maketh a full man; conference a ready man; and writing an exact man."
And that was it - the sum total of the message.
Client: Entourage 10.1.0 on OS X 10.1.5
Andy W
<tip type="PHP Headers key to force download in IE on a secure server"
author="Andy Warwick">
Having set up a site to dynamically create reports that the user could
download, and having it work fine in testing, only to break when it got
moved to a secure server, I found the problem was a combination of SSL,
sessions, and the headers being sent; IE needs extra headers The final
solution was the following:
<?php
$file = $_GET['file'] ;
$download_dir = DOWNLOAD_DIR ;
$download_file = $download_dir . $file ;
ob_end_clean(); // clear the buffer
// this is what stops the error
if ( ereg ( "MSIE" , $_SERVER['HTTP_USER_AGENT'] ) )
{
header ( 'Pragma: ' ) ;
header ( 'Cache-Control: cache' );
}
header ( 'Content-Type: application/octet-stream' ) ; // text/plain
header ( 'Content-Disposition: attachment; filename='.$file ) ;
header ( "Content-Length: ".filesize ( $download_file ) ) ;
header ( "Content-Transfer-Encoding: binary" ) ;
$fh = fopen( $download_file , "r" ) ;
fpassthru( $fh ) ;
?>
</tip>
More information about the thelist
mailing list