Tips & Tricks - Media types and file icons

If special files are saved and provided for download in a portal, a standard icon for unknown file types will be 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. Extend the mimemap-custom.xml

This file is located in the portal directory internal/cfg and can be supplemented with custom definitions for mime types using the following scheme:

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

An Autocad file, which has the .dwg type, requires the following entry:

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

An interesting source to help define MIME types is available here.

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 have the .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. Assign mime types 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 the portal service

Finally, restart the portal service.