Forum OpenACS Development: fix for file storage
- tries to look up the mimetype using the cr_mime_types
- if it fails, tries to guess the mimetype using ns_guesstype (which basically looks at the AOLserver config file).
- if it finds a mime type, it inserts it into cr_mime_types
It doesn't seem right for code to randomly update cr_mime_types. Also, the only time new mime types might show up from ns_guesstype is if new ones have been added to AOLserver.
I've implemented and tested a local fix that changes acs-content-repository and file-storage:
- on boot time, acs-content-repository scans AOLserver declared mime types and inserts them into cr_mime_types if necessary
- file storage simply looks things up in cr_mime_types, never trying to insert new types along the way.
If people think this is the right way to go, I'll commit my fix (to HEAD not the 4.6 branch, seems like too big a change for the 4.6 branch).
You do want to map multiple extensions into one mime type and duplicate mime types in cr_mime_types is a pretty ugly thing from the standpoint of pulling content out (I think there are a number of places it is assumed mime type is unique in that table).
I'll put together a prototype of this at some point. Won't commit until I have the full fix. (and I want to focus on forums/notifications first, too).
(I offer to do it if nobody else wants to)
Do you think it can be merged in oacs-4-6 as well? After all we want to get rid of all the bugs in there before releasing it ...