Tips & Tricks - MIME Types and File Icons

If specific files are stored in a portal and made available for download, the icon for unknown file types is displayed. Files such as those from CAD programs are missing from the default lists. This post shows how to extend the MIME types in Intrexx. When this happens, the corresponding file icon is displayed, and the file is opened in the appropriate application when accessed in the browser.

To extend the MIME types in Intrexx, follow these steps:

1. Extending mimemap-custom.xml

The file is located in the portal directory `internal/cfg` and can be supplemented with your own definitions for MIME types, whereby the following The following schema is used:

            <entry extension="file identifier" mimetype="mimetype"/>
        

For an AutoCAD file with the .dwg extension, the following entry is used:

            <entry extension="dwg" mimetype="application/acad"/>
        

2. Icons for additional file types

The icons displayed in Intrexx's download controls are stored in the portal directory external/htmlroot/images/assets/filewalker/ext. Names are assigned according to the following scheme:

            <file identifier>.gif
        

For AutoCAD files, the naming convention would be:

            dwg.gif
        

The files can also be in .svg, .png, or .jpg format. To do this, the mapping table must be defined accordingly in Step 3. Larger images are particularly advantageous for tablets and smartphones, as users can tap them with their finger to download them.

Sources for alternative icon files

https://365webresources.com/10-flat-filedocument-type-icon-sets-free-download

3. Assigning MIME types to icon files

In the portal directory `internal/cfg`, the `fileextension.properties` file defines the mappings between file extensions and icon files. The procedure for this is

            <file identifier>=images/assets/filewalker/ext/<file identifier>.gif
        

Example

            dwg=images/assets/filewalker/ext/dwg.gif
        

The file format can also be .png or .jpg if the file in the icon directory is in that format.

4. Restart the portal

Next, restart the portal service.