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