Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't open .log attachment with IE 1

Status
Not open for further replies.

chrisdq

Programmer
Nov 6, 2002
77
US
Hi,

I have an ASP page that has links to attachments that reside on the server but IE can't open files with a .log extension directly. It tries to download the file to a hidden directory (content.ie5) then opens from there but then reports that file not found.
I can view other files (.txt, .bmp) directly from the server with any problems.
BTW, I have no problem viewing .log files with Firefox but I have co-workers mostly use IE.
Does any one run into this problem before and know how to fix this?

Thanks in advance.
 
It's basicly because IE can't figure out the content type. As a test, add the following line to the top of the log file & I bet IE will open it properly:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

The full solution will probably be to add a default content type to your server (if needed) or add a specific type for .log files as text/html, but test it the easy way above first.
 
how do you add a specific type as text/html?

When I create a blank file with .log and it's recognized as a text file then does this mean it's been added already?

Thanks.
 
Earlier, I assumed that we were talking about a web server. But after re-reading, I think that maybe these log files are not coming through a web server. If it were an apache web server, just adding AddType text/plain .log to the configuration file would probably be enough. I assume that there's something equivalent for IIS.

How are you creating this blank .log file that works properly? What is creating the .log files that don't open properly? I think that there's something in the mime type / encoding of these problem log files that prevents IE from correctly determining there type. If rename one of the problem .log files to .html and then try to open it with IE what happens?

If you open Windows Explorer, Tools, Folder Options, File types tab, is there listing for .log? .log files should be set to open in notepad, but I doubt if this has anything to do with this particular problem.
 
smah

You're absolutely right. It has something to do with IIS.
When I first look at Mine Map in IIS, .log was configured as a something like encode, but when I change it to text/html then IE can open it fine. The only problem is the lines are not lined up properly like a text file (no linefeed), it's all over the place making it hard to read. I don't know why IE can't open the file when I change it to text/plain. I've tried to change to many text type but only text/html works. If I remove it from the list then it doesn't work either.
On another server (development), .log is not even added to Mine Map and it's been working fine. Do you have any idea of what might be wrong?

Thannks,
Chris.
 
Did you try setting the .log files to text/plain? This may or may not change the results. I'm out of my league at this point (I use apache on Linux), but it seems that you've narrowed it down to the IIS configuration. You might find the answer in forum41.
 
Smah,

Yes I did tried text/plain but IE refused to display the content. It tried to download the file to local hard drive but then reported that the file can not be found.
I don't know if there is another setting somewhere that would cause this not to display the content.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top