Accessing TXT files

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
darkgray
-


Joined: 22 Feb 2006
Posts: 2

PostPosted: Wed Feb 22, 2006 1:19 pm    Post subject: Accessing TXT files Reply with quote

I put up a text file (foo.txt) on the webserver, and when I try to access it with Internet Explorer, the file is opened within the browser (OK!), but using Firefox, the browser attempts to download and open it with an external program (not OK!). What is the solution for this? Should I edit the MIME types or something?

Using netcat I figured out that it's sending pretty much the same headers (text/plain) as my Apache server, on which txt-files are opened internally with Firefox, so I'm a bit stumped as to what the problem is.
Back to top View user's profile Send private message
RTAdams89
-


Joined: 06 Nov 2005
Posts: 102

PostPosted: Wed Feb 22, 2006 2:41 pm    Post subject: Reply with quote

This is a user/browser/system preference. The person who views your page can set up their computer to automatically open txt files, or to download them. Not much you can do other than renaming it to .html (which 99% is set to be opened).
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Feb 22, 2006 2:45 pm    Post subject: Reply with quote

Bear in mind if it was HTML you wanted to show in the text file it would simply render it instead.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
darkgray
-


Joined: 22 Feb 2006
Posts: 2

PostPosted: Wed Feb 22, 2006 10:59 pm    Post subject: Reply with quote

Like I mentioned, Firefox will open txt-files internally (within the browser) when served by my Apache server (FreeBSD), while the Abyss server (win32) makes it open it externally. This is what's confusing.
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Feb 22, 2006 11:01 pm    Post subject: Reply with quote

This seems like a MIME-type error then. You should check for errors in yours (if you have changed them).
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Feb 23, 2006 10:42 am    Post subject: Re: Accessing TXT files Reply with quote

darkgray wrote:
Using netcat I figured out that it's sending pretty much the same headers (text/plain) as my Apache server, on which txt-files are opened internally with Firefox, so I'm a bit stumped as to what the problem is.

It is up to the browser to decide what to do with the result of a request (displaying it or asking for downloading it). The server cannot interfere in such a decision.

The MIME type for .txt files is a standard (text/plain) so there is no reason why to change it. You should probably ask Firefox developers why their browser behaves this way.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
kev1952
-


Joined: 08 Sep 2005
Posts: 105
Location: Townsville Australia

PostPosted: Sat Feb 25, 2006 6:56 am    Post subject: Reply with quote

If you have PHP installed then you can simply "include" it in the code for the page, like:
Code:
<? include "blah.txt"; ?>

To use it like this you would need to use a HTML page and change the extension for the page filname to .PHP or you could just link to the code above from a HTML document (after you have saved it as "blah.php") with a line like this:
Code:
<a href="blah.php">Some Text</a>

I knocked up a quick and dirty page as an example - have a look at http://kevsplace.no-ip.org/text.html and you will see it working.
_________________
Cheers.... Kev

Kev's Place - http://www.kevsplace.com

Powered by Abyss X1.
Back to top View user's profile Send private message Send e-mail Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sun Feb 26, 2006 10:52 pm    Post subject: Reply with quote

Im running Firefox v1.5 (newest) and haven't run into this problem. :/
Back to top View user's profile Send private message Visit poster's website
kev1952
-


Joined: 08 Sep 2005
Posts: 105
Location: Townsville Australia

PostPosted: Mon Feb 27, 2006 4:08 am    Post subject: Reply with quote

I also run FF1.5 and dont get the problem either.
_________________
Cheers.... Kev

Kev's Place - http://www.kevsplace.com

Powered by Abyss X1.
Back to top View user's profile Send private message Send e-mail Visit poster's website
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Mon Feb 27, 2006 9:27 am    Post subject: Reply with quote

No, I don't either (when I run it (bug fixing for a site I'm developing (how non-standards complent can you get, after IE?)). I just get crashes from massive memory leakes.
_________________
Olly
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group