|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Serving pain text?
Hi, I'm not sure if this is the right place to post...
I need my log-files to open onto a webpage. Is there any way to do this? I tried addidng the .log extension to the Text/Plain mime-type but that starts a browser download dialogue. Text/Html is closer but it can't see the linebreaks and so the formatting sucks accordingly. I'm sure I've seen plain text documents served-to-browser before. Any suggestions would be great. (as the only alternative I can think of is a serverside 'CAT' style program to append the hypertext tags. god forbid!) ![]() Last edited by Slurm : February 9th, 2004 at 05:58 AM. |
|
#2
|
|||
|
|||
|
I think this is a browser issue.
I added "AddType text/plain .log" to my httpd.conf then tried. IE > Opens in Notepad. When I tried a few months back it asked me to download the file instead. Konqueror > Fine Mozilla on linux > Fine Mozilla (firebird and mozilla) on Win > Fine I tried with text/html but but the results were the same, except that as you said, all browsers wouldn't process linebreaks. Basically it seems that IE always tries to open the files externally. Quote:
Yep. But the file has to have the .txt extension instead of .log. That's the only way IE will open the file in itself. Also that way you don't have to add anything to you htppd.conf either.
__________________
Google :: Apache Manual :: FreeBSD Handbook
SourceHack :: SourceHack Forums :: SourceHack IRC UNIX is simple; it just takes a genius to understand its simplicity!!! Last edited by kolatracks : February 9th, 2004 at 08:01 AM. |
|
#3
|
|||
|
|||
|
Thanks Kolatracks.
I'll try and persuade my packet logger to spit out files with a .txt extenson then. I should have known IE would be at the bottom of all this! ![]() |
|
#4
|
|||
|
|||
|
Hopefully the logs are not too painful. But as for plain text...
According to HTTP, filenames don't matter at all. The log files could be named billg.jpeg, but if the MIME type is text/plain, they should be handled as text/plain, but there have definitely been some bugs with MS Windows sometimes using MIME types and sometimes extensions. I think there have even been some security problems related to this, ie, one part of Windows looks at the MIME type (text/plain) and another part of windows looks at the extension (.exe) resulting in big problems. ----------- WAP hosting Last edited by ChiralSoftware : March 10th, 2004 at 12:08 AM. |
|
#5
|
|||
|
|||
|
Yep.
From my experience windows/IE (microsoft in general I suppose) is completely ignorant of mime types. And this is the perfect example. Even though both .log and .txt files are associated with text/plain, one is served in the browser, the other opened in notepad or prompted for download. How we all love windows .Anyway that's my anti-microsoft post for today. Last edited by kolatracks : February 9th, 2004 at 04:16 PM. |
|
#6
|
|||
|
|||
|
Unix
Unix has its own wonderfulness of "magic numbers". I think both Unix and Windows are moving towards allowing attributes such as real MIME types to be specified as file metadata. And Linux is getting real UTF8-clean-everywhere support in its filenames, so finally we'll be able to have any UTF8 filename and the MIME type will handle everything correctly.
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Networking Help > Serving pain text? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|