Re: Download File MimeType
Re: Download File MimeType
- Subject: Re: Download File MimeType
- From: Jonathan Rochkind <email@hidden>
- Date: Thu, 25 Mar 2004 12:49:43 -0600
Mine ain't all that special, and isn't in a format that would be
useful to anyone else (it's in my database, and bound up with my own
custom stuff going on).
But looking around a bit, I easily find Apache's much more extensive
one. If you have apache, look in the 'conf' directory at a file
called "mime.types".
--Jonathan
At 1:40 PM -0500 3/25/04, Kieran Kelleher wrote:
Jonathon,
any chance you could publish your MIME-extension mappings list to
save us newbies some typing and give us a starting point for our
db's! :-)
Thanks, Kieran
On Mar 25, 2004, at 12:52 PM, Jonathan Rochkind wrote:
At 8:54 AM -0600 3/25/04, James Cicenia wrote:
Hello -
How do people manage the mime type? Do you just parse
the suffix of a document? How does a file system tell the
browser the mimetype?
Well, it's not neccesarily the _file system_ that is telling the
browser the mime content type, so the browser can forward it with a
request. But where does the browser get this from? It depends on
the file system. Windows uses the 'extension' (ie suffix) only, as
far as I know. Mac OS9 uses the type/creator codes. OSX may use
some combination of type/creator codes (those still exist in OSX,
don't they?) and suffix. Unixes probably use the extension, but
map the extension to content type with application-specific mapping
files, instead of a universal OS mapping file that I'm betting
Windows and Mac have (although I don't really know).
How do I do it? Well, if it's a file uploaded by the browser, then
the browser will usually send along a mime type. I record this
mime type in the db with my record for the file, so I know what
mime type it is. If for some reason the browser does not send along
a mime content type (or it sends along a type that's not in my list
of recognized types---I only accept some types), then I look at the
file's dot-extension. I have a list in my db of dot-extensions and
what mime type they correspond to. So when I determine the proper
mime content type from the extension, I store that in the db, just
like if I got it from the browser. [There may be lists of
extension/mime-content-type mappings sitting around in your OS or
your webserver (apache) already; since I only support a limited set
anyway, I just created my own list in the database, rather than try
to find an existing all-encompassing one from some other source.]
--Jonathan
-James Cicenia
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.