Tips & Tricks - Mimetypes and file icons

If special files are stored in a portal and made available for download, the icon for unknown file types is displayed. Files, such as from CAD programs, are not included in the standard lists. This workshop demonstrates how the media types in Intrexx can be extended. The corresponding file icon will then be displayed and the file will be opened in the corresponding application when it is selected in the browser.

To extend the media types in Intrexx, please proceed as follows:

1. Extending the mimemap-custom.xml

The file is located in the portal directory internal/cfg and can be supplemented with your own definitions for mimetypes, with the following Scheme is used:

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

The following entry is used for an Autocad file of type .dwg:

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

2. Icons for additional file types

The icons, which Intrexx displays in download controls, are stored in the portal directory external/htmlroot/images/assets/filewalker/ext. The following pattern is used to name these:

            <file identifier>.gif
        

Therefore, Autocad files would be named as follows:

            dwg.gif
        

The files can also be created in .svg, .png or .jpg format. The assignment table in step 3 needs to be defined accordingly to achieve this. Larger images are more ideal for tablets and smartphones as these need to be pressed with a finger.

Sources for alternative icon files

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

3. Assignment of the mimetypes to the icon files

The file extensions can be assigned to the icon files in the file fileextension.properties in the portal directory internal/cfg. The pattern 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 has the corresponding format.

4. Restart portal

Finally, restart the portal service.