You can access the umbracoExtension property of a Media Item, eg:
<xsl:choose> <xsl:when test="Exslt.ExsltStrings:uppercase($mediaNode/umbracoExtension) = 'JPG'"> this is a .jpg file </xsl:when> </xsl:choose>
I threw an uppercase in there as I'm not sure if Umbraco changes the case of the extension or uses the exact one on the file, so this will handle either case.
How can i get the file type of a media items
How can i get the file type of a media items. ie jpg , pdf etc.
Hi Anthony,
You can access the umbracoExtension property of a Media Item, eg:
I threw an uppercase in there as I'm not sure if Umbraco changes the case of the extension or uses the exact one on the file, so this will handle either case.
-Tom
is working on a reply...