Reply to Re: Link, which always offers to save/open....

Your name:

Reply:


Posted by jodleren on 03/27/07 19:23

On Mar 13, 9:04 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
> jodleren wrote:
> > Toby A Inkster <usenet200...@tobyinkster.co.uk> wrote:
>
> >> Google: HTTP Content-Disposition header
>
> > You could be a little more specific...
> > I found something
>
> Firstly, I was clearly sufficiently specific, in that it lead you to an
> answer.
>
> Secondly, I couldn't be very much more specific than I was, as you didn't
> mention any details of your hosting situation in your original post.
> (Operating system, server software, scripting languages, level of access,
> etc.)
>
>
>
> > and came up with:
> [...]
> > header('Content-type: application/force-download');
>
> Replace that line with a real content type. For example, if the file is a
> PDF, then the Content-Type should be "application/pdf". If it's a JPEG,
> then "image/jpeg". If you are really unable to determine the correct
> content type, use "application/octet-stream".

Would there be a problem with getting the extension of the file and
using it, such as:
$ext = get_extension_of_file;

header("Content-type: application/$ext");

>
> Using made-up content types like the one you've used above may seem to be
> "convenient", but it harms the web as a whole.

What do you think about this?
header("Content-Disposition: attachment; filename=\"$file\"");

Is there a place where headers are listed?
I could use that now

BR
Sonnich

[Back to original 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

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