Re: Identifying (X)HTML without MIME

Ideally, you should rely on the underlying OS to tell you what the mime 
type of a file is.  A Windows OS will use a file's extension and the 
Registry to figure out the type; a linux/unix os may use the magic number 
database; MacOS X may use the resource bundle.  How to ask the system for 
this kind of info depends on the language you use.


Dmitry

At 02:48 PM 11/6/2004, James Cerra wrote:
>Now HTML was origionally designed for transport over
>the web via HTTP and identification via MIME types.
>However, there are cases where (X)HTML may be
>transmitted with no MIME type information available.
>e.g. Reading a file from a FAT disk or though standard
>io.  I'm writing a program where this type of
>situation may come up.  The specs are silent on the
>issue, so: What are the recommendations for
>identifying the document's type when MIME or HTTP is
>not available?
>
>-- Jimmy Cerra

Received on Monday, 8 November 2004 22:15:39 UTC