How to change mime type in database (mod file)


According that all browsers don't manage mimetype as elgg do, some file doesn't have the right icon's.

I thought that I could change some record in database so that elgg display the correct icon's. I'm in the good way ? In case wich table should I update ?

I read the docs.elgg (database), read many discussions, searching in views and php file but can't find nothing :-( ?

Could You help ?


  • Just say when I'm upload a pdf file

    Using elgg 1.8.x with OVH as Isp (all add mods desactivated)

    Desjtop on Win XP service pack 3

    Browser Firefox 27.0.1 : mimetype pdf file not right recognize

    Chrome Version 33.0.1750.146 m : mimetype pdf ok

    IE 8.0.06001.18702 : mimetype pdf ok

  • Understand, that I can't ask users to reload their files with another browser and I don't want to do it file after file.

  • Take a look at the core file plugin to see how it's handled.  If you check out the download script the mimetype is set in the headers there.

  • I found my way and share ;-)

    Table metastring search for elgg application mime type :

    - application/force-download

    - application/msword

    - application/pdf

    - application/vnd.openxmlformats-officedocument.wordprocessingml.document

    Get the id value

    Change the corresponding value for your guid entity in

    Table metadata -> value_id

  • I want to extend your experience:

                'application/excel' => 'xls',
                'application/msword' => 'doc',
                'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
                'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
                'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',
                'application/pdf' => 'pdf',
                'application/powerpoint' => 'ppt',
                'application/' => 'xls',
                'application/' => 'ppt',
                'application/vnd.oasis.opendocument.text' => 'open',
                'application/x-gzip' => 'arc',
                'application/x-rar-compressed' => 'rar',
                'application/x-stuffit' => 'archive',
                'application/zip' => 'zip',
                'image/vnd.djvu' => 'djvu',
                'application/x-shockwave-flash' => 'swf',

                'application/ogg' => 'music',
                'application/x-gzip' => 'archive',
                'application/x-rar-compressed' => 'archive',

                'text/directory' => 'vcard',
                'text/v-card' => 'vcard',



    Just learn it