You are here: Re: ISO CD Image file is being sent as HTML « HTML « IT news, forums, messages
Re: ISO CD Image file is being sent as HTML

Posted by Jim Higson on 03/19/06 20:56

Switchy wrote:

> The reason that I asked you if you use Mozzila is:
>
> IE can recognize a lot of extensions,

Just a note, but file extensions in the URL aren't really a very good way to
decide what type the content is. When Tim Berners-Lee designed the WW, he
decided to use an HTTP header ("Content-Type") instead.

Off the top of my head, there are a few reasons why putting too much faith
in extentions isn't a very good idea on the WWW:

1) A lot of servers like scripts to have a certain extension, but this
rarely indicates the type of content being served. For example, a URL that
ends in ".php" could serve an (X)HTML page, a CSS sheet, a PNG image, plain
text, an SVG image... anything! This isn't just an academic thing, for
example check out the page on a site I run:

http://surfcore.co.uk/node/293

All the URLs for user images except the first one end in ".php" because they
are scaled as requested.

2) HTTP has something called content negotiation. (the Apache implementation
of this is called multiviews). Using content negotiation,
http://example.com/images/me might return a SVG to very modern browsers, a
PNG to recent-ish onces and a GIF to very old ones. The browser should tell
the server what it supports when it requests the image.

3) It is in many cases a bad idea to have the file extentions in URLs since
it is an implementation detail and not of interest to most users. Serving
ISO images is a bit of an exception to this because the user *is*
interested in the type of the file.

4) Which extention is for which file type are only really a convention,
whereas MIME types are (mostly) formally registered.

5) Only really MS Windows uses file extentions to decide what type a file
is. Unix typically looks at the contents of the file itself to decide.

> otherwise, with mozzila you have to contact your provider
> who can define the extension on server.

Not necessarilty. This can be done in htaccess. The server is at fault
though, it is telling the browser that the content is "text/html" and the
browser is believing it. It might be frustrating in the short term, but in
the long run I find web development less frustrating if the browser
believes what the server tells it instead of trying to second guess it all
the time.

Hope this is of interest,
Jim

> That happens to me with MSI (Microsoft Installer) extension.
>
> DO not use Mozzila is just a game for kids.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация