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!

"you have chosen to open" when trying to open html file 1

Status
Not open for further replies.

ardan

Technical User
Apr 22, 2003
27
US
Hi,

I have an apache server running on a xp box. Everything works great with any pages with .php but if I try to open a .html file I get a "you have chosen to open" requester and a choice to open or save....This only happens in firefox not in IE but it does happen on every computer running firefox...

Any ideas??
thanks ardan...

End of Line
 
Hi

ardan said:
I get a "you have chosen to open" requester and a choice to open or save....This only happens in firefox not in IE
That sounds like the typical situation when no [tt]Content-type[/tt] header is sent by the web server.

Those the companies just implemented different sentences of the HTTP protocol :
[ul]
[li]FireFox : "If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".".[/li]
[li]Explorer : "If and only if the media type is not given by a [tt]Content-Type[/tt] field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource."[/li]
[/ul]
So both are correct ( ok, FireFox is more correct ), the wrong is probably the web server administrator.

Check the HTTP response headers in both browsers with the appropriate tools :
[ul]
[li]FireFox : LiveHTTPHeaders[/li]
[li]Explorer : ieHTTPHeaders[/li]
[/ul]
The [tt]Content-type[/tt] probably is missing. Check your httpd.conf file for [tt]DefaultType[/tt], [tt]SetHandler[/tt] and [tt]AddType[/tt] directives.

Or post the relevant parts of the httpd.conf file.

Feherke.
 
Thanks for your response Feherke,

I kind of inhered this and I am a Newbie..

Here are the parts of the http.conf file I think you needed

**************************
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

#


----------------------------------------------------------------------------------



# The Options directive is both complicated and important. Please see
# # for more information.
#
Options -Indexes FollowSymLinks

Options Includes ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex index.html index.htm index.cgi
AddType text/x-server-parsed-html .html .htm .ssi

#
-----------------------------------------------------------------------------


<Directory "C:/Program Files/Apache Group/Apache2/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all

<Files *.html>
SetHandler type-map
</Files>

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
</Directory>



----------------------------------------------

********************

Thanks again for any help...I am lost on this issue...

ardan


End of Line
 
Hi

ardan said:
[tt]AddType text/x-server-parsed-html .html .htm .ssi[/tt]
Who put that there ? That results the following header line :
Code:
Content-Type: text/x-server-parsed-html
Which is meaningless to the browsers. By the way, neither Opera displays the page.

Comment it out. Probably nothing will mis it.

Feherke.
 
Thanks Feherke,

That seems to have fixed it, I am not sure where the line came from but when I commented it out then Firefox started working...

Thanks Again,,

Ardan

End of Line
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top