Networking Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationNetworking Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 9th, 2004, 05:55 AM
Slurm Slurm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 55 Slurm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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.

Reply With Quote
  #2  
Old February 9th, 2004, 07:58 AM
kolatracks kolatracks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: UK
Posts: 311 kolatracks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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:
I'm sure I've seen plain text documents served-to-browser before.

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.

Reply With Quote
  #3  
Old February 9th, 2004, 08:22 AM
Slurm Slurm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 55 Slurm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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!

Reply With Quote
  #4  
Old February 9th, 2004, 03:19 PM
ChiralSoftware ChiralSoftware is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Beverly Hills
Posts: 45 ChiralSoftware User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to ChiralSoftware
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.

Reply With Quote
  #5  
Old February 9th, 2004, 04:11 PM
kolatracks kolatracks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: UK
Posts: 311 kolatracks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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.

Reply With Quote
  #6  
Old February 9th, 2004, 04:16 PM
ChiralSoftware ChiralSoftware is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Beverly Hills
Posts: 45 ChiralSoftware User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to ChiralSoftware
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationNetworking Help > Serving pain text?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway