Yes, it is possible. To do it, you need to use a /FILE_MATCHES_...
section (as described in the dirhtml "Help -> Links" page).
First, copy all needed icons to a web location, or to the location
where the html file will be generated.
Next, create a text file that lists the file types and associated html
code. For example (to be saved in the dirhtml folder as "file matches
code.txt"):
/*.xlsx|*.xls|*.xlm|*.xslt
<img src="excel-icon.png" />
/*.pdf
<img src="pdf-icon.png" />
/NO_MATCH-DIRHTML
<img src="generic-icon.png" />
Finally, add this to the dirhtml script:
/FILE_MATCHES_BEFORE_A
file matches code.txt
Note that using "/>" is XHTML format. For regular html, use > to
close <img ...> tags.
If the icon files are on a server, use a fully qualified URL, for
example:
/*.xlsx|*.xls
<img src="
http://my-domain.com/icons/excel-icon.png" />