You are here: Re: Link, which always offers to save/open.... « HTML « IT news, forums, messages
Re: Link, which always offers to save/open....

Posted by Andy Dingley on 03/28/07 12:39

On 13 Mar, 15:56, "jodleren" <sonn...@hot.ee> wrote:

> I need a link to some files, which should not be opened by the browser
> or plugins.

Browsers only do this if two things happen: They know what type the
document claims to be, and they know a way to handle this type.

If they don't have both of these, then they are forced to ask the user
what to open it with / save it as a file (or throw it away!).

So if you serve a document (any document, even HTML) with the HTTP
content-type of application/octet-stream, all the browser can do is
handle it as raw bytes. It will almost certainly allow it to be saved,
it might give an option to select a program to open it with.

If you have a scripting language on the server, then you can do this
easily. If you don't, but you're using Apache, then you can
configure .htaccess to serve this content-type for all files with
either a particular file extension, or files from a particular
directory.

 

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

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