Forum OpenACS Development: Re: primary key in cr_mime_types

Collapse
Posted by Jeff Davis on
I have created the table and have some data for populating it but the question is should we just quit using ns_guesstype and maintain it all ourselves. I looked at the raw data for ns_guesstype and it is wrong in some cases (like .zip -> application/x-zip-compressed rather than application/zip which iana lists) and is missing a lot of what people really upload (all the MS mime types for example), and has some DCI/AOL internal ones (or ones I have never seen anyway like .ani mapping to application/x-navi-animation). It can of course be overridden but maybe it would be better to maintain our own.

Also, ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types lists about a zillion mime types and I wonder if we should just create most of them by default (which would mean tracking down extensions for most of them).

Another issue is that as it stands I have defined the table as:

create table cr_extension_mime_type_map (
   file_extension       varchar(200) 
                        constraint cr_mime_type_extension_map_pk
                        primary key,
   mime_type            varchar(200) 
                        constraint cr_mime_ext_map_mime_type_ref
                        references cr_mime_types
); 
which would mean a unique entry per extension. I know it's not really valid but I think until we do the work on the UI side to allow for chosing the correct mime type it's probably better to enforce uniqueness.

The final one is that for some things I am not sure what the right generic extension to return would be when more than one is listed (the ext in cr_mime_types). An example being application/quicktime where both .qt and .mov are used.

Anyone want to figure it all out for me?