|
Posted by d on 09/27/11 11:39
"John" <no@email> wrote in message
news:43eb3d89$0$29571$da0feed9@news.zen.co.uk...
> John wrote:
>
>> Hi,
>>
>> I'm using php to provide Excel files stored in a database to web users.
>> The important part of my code is this:
>>
>> $buffer = mysql_result($result, 0, 'survey');
>> header("Content-type: application/excel");
>> header("Content-disposition: attachment; filename=test.xls");
>> echo($buffer);
>>
>> This works perfectly with firefox, but not at all with IE.
>>
>> I just get the pop-up "Internet Explorer cannot download viewdoc.php from
>> <site_name>. Internet Explorer wa snot able to open this Internet site.
>> The requested site is eitherunavailable or cannot be found. Please try
>> again later.
>>
>> Any suggestions?
>>
>> BTW, if i change the content type to application/vnd.ms-excel, all it
>> does is give me a security warning before providing the same error
>> message.
>>
>> John
>
> Sometimes it helps to write down your thoughts when solving problems.
>
> After a re-google, I saw this snippet on Joseph Scott's blog:
>
> if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
> session_cache_limiter("public");
> }
>
> Put this in before the session_start() command, and all is well.
>
> Original Source: http://tinyurl.com/9jva2
>
> Cheers,
>
> John
I just send:
header("Cache-control: private");
and all is well :)
[Back to original message]
|