You are here: Re: [PHP] Content Header « PHP « IT news, forums, messages
Re: [PHP] Content Header

Posted by Matthew Weier O'Phinney on 07/22/05 18:26

* "Richard Lynch" <ceo@l-i-e.com> :
> On Thu, July 21, 2005 4:55 am, Chris Shiflett said:
> > Christopher J. Umina wrote:
> > > I currently have a script which streams data out of a MySQL database,
> > > and prints the content headers correctly, however, when I use the
> > > following line:
> > >
> > > header("Content-Disposition: attachment; filename=\"". $filename ."\"");
> > >
> > > it prompts the user to download the file each time they go to the site.
> >
> > Then it works. :-)
>
> But it will only work on *SOME* browsers -- those which honor the
> johnny-come-lately Content-Disposition header.
>
> Use Content-type: application/octet-stream to guarantee it gets downloaded
> in ALL browsers.

The OP indicated s/he *was* setting Content-Type.

They were also sending Content-Disposition in order to indicate the
suggested filename -- and wanted to alternately either send the filename
*or* have the content echoed to the screen. The 'solution' was to use
different URLs, and set Content-Disposition to either 'attachment' or
'inline', respectively.

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

 

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

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