You are here: Re: displaying binary data to browser and set mime type « PHP Programming Language « IT news, forums, messages
Re: displaying binary data to browser and set mime type

Posted by Alvaro G. Vicario on 12/11/05 00:50

*** GS escribió/wrote (8 Dec 2005 09:03:00 -0800):
> Im new to PHP. I am looking for a link or help on how to set the
> mime type in my php script as well as send binary data to the browser
> window instead of having it ask me to save the file.

Setting MIME type is easy:

header('Content-Type: foo/bar');

You can also tell the browser to display data inline:

header('Content-Disposition: inline; filename="foo"');

That's the server-side work. Now you need that the browser follows the
directions provided by the server, and that's going to be your main
difficulty. Internet Explorer is well known for ignoring these directions
so you'll need a lot of tweaking. Firefox though tends to obey them.


--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--

 

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

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