Get file/image mime type from a fetched node

Author Message

Softriva .com

Sunday 25 February 2007 3:29:58 am

How to get the file/image mime type from a fetched node. I mean how do I know if the file is pdf or doc or jpg or gif

Claudia Kosny

Monday 26 February 2007 3:20:17 am

Hi OOzy

The content of the an attribute of type file is an ezbinaryfile object which has the property mime_type. See also here http://ez.no/doc/ez_publish/technical_manual/3_8/reference/objects/ezbinaryfile

Thus you should be able to fetch the mimetype like this (not tested...)
{$node.data_map.file_attribute.content.mime_type}

Claudia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.