You are here: Re: Excel files from Database (firefox / IE difference) « All PHP « IT news, forums, messages
Re: Excel files from Database (firefox / IE difference)

Posted by John on 10/04/84 11:39

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация