Forum OpenACS Q&A: Where should new mime types be added?

Collapse
Posted by Tracy Adams on
My goal is to add a list of mime-types of OpenACS.  There are 2
places that store mime types
<ol>
<li>AOLServer config file
<li>cr_mime_types database table
</ol>

When I file is uploaded in file storage, the procedure
fs_maybe_create_new_mime_type determines the mime type.
This procedure determines the  mime type using the config file.
If the mime type is not in the database, it will be inserted into the
database.  However, if a mime type is in the database but not in
the config file, it will never be available for use.
<p>
I'm checking if this is the intent before I move on.  A possible
approach is to include the common mime types in a sql
installation file  so they would be available regardless of
configuration.  In fact, there are a few mime types in the sql files
right now.  However,  fs_maybe_create_new_mime_type is not
compatable with this approach at this time.

Collapse
Posted by Don Baccus on
This strikes me as being an error on the part of fs_maybe_create_new_mime_type.  However ... for the moment it is probably best to leave it as is unless you have time to generate and test a patch to remove the dependence of file-storage on the AOLserver config file.  I know there's no dependence on the file download side because I rewrote it a few months ago.  So presumably the only dependence is in the proc you're mentioning.

We generated a long list of MIME types at Greenpeace about three-four weeks ago that we loaded into the CR mime type tables.  I need to move that into the OpenACS 4 tree when I get some time.  It's a fairly comprehensive list of multimedia and document file types.  It is the complete list from some mime type/extension map one of the Greenpeace folks dug up on the web ...