Hi,

I want to authorize uploading of CML
files<http://en.wikipedia.org/wiki/Chemical_Markup_Language>on my
wiki <http://wiki.jmol.org/index.php/Main_Page>.
These files have an XML format with a limited set of possible root elements.
I would like them to be recognized by MediaWiki with a specific MIME type :
chemical/x-cml

I'm doing some tests on a virtual machine Ubuntu 10.10 with default
MediaWiki setup (MW 1.15.5, PHP 5.3.3, MySql 5.1.49).
I have done several modifications in the configuration :

   - $wgFileExtensions[] = 'cml'; in LocalSetting.php to allow the .cml
   extension
   - chemical/x-cml cml; in includes/mime.types to attach the MIME type to
   the extension
   - $wgXMLMimeTypes = array_merge( $wgXMLMimeTypes, array( ... ) ); in
   LocalSettings.php so that MimeMagic correctly detects CML files as
   chemical/x-cml

When I upload the file, everything is ok and in the debug log the file seems
correctly detected as chemical/x-cml.
Even in the database, the file is stored with the correct MIME type.

But when I display the File: page for this file, I see "MIME type:
unknown/unknown" displayed by MediaWiki (same problem in the debug log).
What do I need to do to have the MIME type correctly detected once the file
is uploaded ?

I want to develop a media handler for this kind of files, so I need to
have correct Mime type detection.

Thanks in advance.
Nico
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to