[pmwiki-users] Force downloads

Algardas alglt at yahoo.com
Tue Jul 17 06:35:48 CDT 2007


On Mon, 16 Jul 2007 21:54:44 -0700
Ian MacGregor <lists at imacgregor.com> wrote:

> If I have Site/file.txt and I want visitors to download it instead of opening 
> it in a page, how can I do that? Usually clicking on Attach:Site/file.txt 
> will cause it to open in the web browser as if it were an html page. Is there 
> such thing as ?action=download ? How do you force an attachment to download 
> instead of opening?
> 
> Regards,
> Ian MacGregor


Your text files get opened in the web browser, because your browser recognises the mime type "text/plain", which is assigned to the *.txt files by the web server.

* A user should just save the file using the browser menu or ctrl+s on most guis.
* You could also think of some other file extension (or no file extension).
* Or you could change the mime type for *.txt files, but I think you can only do this in the web server config (never had anything to do with it, so don't know for sure, actually). I'm also not sure it would be a good idea.

-- 
Algardas



More information about the pmwiki-users mailing list