• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Download File MimeType
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Download File MimeType


  • Subject: Re: Download File MimeType
  • From: Kieran Kelleher <email@hidden>
  • Date: Thu, 25 Mar 2004 13:40:38 -0500

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.


  • Follow-Ups:
    • Re: Download File MimeType
      • From: Jonathan Rochkind <email@hidden>
References: 
 >Download File MimeType (From: James Cicenia <email@hidden>)
 >Re: Download File MimeType (From: Jonathan Rochkind <email@hidden>)

  • Prev by Date: Re: Download File MimeType
  • Next by Date: Re: Download File MimeType
  • Previous by thread: Re: Download File MimeType
  • Next by thread: Re: Download File MimeType
  • Index(es):
    • Date
    • Thread