opening a text document to show a .txt file through a browser link

Mark Scott mas001 at mscott.cx
Sat Dec 28 20:50:25 EST 2002


Ole Jensen wrote:
> Question:
> Example: when you want to check someone's .css file then you type in the url
> of the .css files location, and a text editor appears with the style codes
> within it. (everyone knows this right!)
> 
Actually, no, the CSS file appears as text in my browser window (and yes 
the MIME-type of the file is text/css). I haven't knowingly changed any 
settings to get it to do this.

> now What I would like to do is to have the same effect with text file that I
> have *linked* to.
> 
> I get the effect I want if I type in the url of the txt file. but I dont
> want to type in the url I just want click the link and have a text editor
> showing me the code, not the browser as it is now!
> 

It all depends on the user's setup. There may be tricks to get the 
system to do otherwise, but these are almost certainly only tricks that 
exploit the way things are handled in certain versions of certain 
browsers, and might change at any point.

-- 
Mark Scott




More information about the Python-list mailing list