The fm:FileInfo component allows you to get all the information for a specific file (media) in your application.

Example 1:

The following example shows the title, rating, approved comments and not denied comments for a specified media id, which is passed as mid.

<fm:FileInfo mid="12345"> Title: <b>{$$media.title</b><br /> Rating <b>{$$media.rating</b><br /> Approved comments <b>{$$media.approvedcomments</b><br /> Not Denied Comments <b>{$$media.notdeniedcomments</b><br /> </fm:FileInfo>

Supported attributes

dateFormatOptional%Y-%m-%d %H:%i:%sThis attribute allows you to change the way dates are displayed within the list. By default it will be YYYY-MM-DD HH:MM:SS. The format which should be used is the same as PHP's date() function.
includeConversionInfoOptionalN/AIf set, this will return a conversion information array
noCacheOptionalN/AIf set cache on this call will be disabled - rarely needed

Template variables

media.approvedcommentsThe total number of approved comments for this file.
media.notdeniedcommentsThe number of comments that have not been denied for this file.
media.channelThe channel-id if the file was associated to a channel.
media.channel_nameThe name of the channel if the file was associated to a channel.
media.channel_shortnameThe 'shortname' of the channel if the file was associated to a channel.
media.contenttypeThe mimetype of the file, for example: audio/mp3.
media.conversiontimeThe time needed to transcode the file, in seconds.
media.converttimeThe date and time when the transcoding was completed for this file.
media.commentcountThe total number of comments to this file.
media.dateThe original creation date of the file. If we cannot detect this, this will be the same as the upload date.
media.durationThe duration of the file in a human-readable format (example: 00:01:07).
media.extensionThe original file extension, for example 'mp4'
media.filetypeThe filetype. This is specified as a number between 1 and 4. Read below for more information.
media.filenameThe original filename
media.filesizeThe size of the file, in bytes.
media.heightThe height of the original file in pixels.
media.hitsThe number of views the file got.
media.idThe unique id of the file.
media.injectorA string describing the application that created the file, for example Uploader or Recorder.
media.lengthThe duration of the file in as a floating point number in seconds. (example: 187.33, for 3 minutes, 7 seconds)
media.messageThe description of the file.
media.metadataUser-defined or developer-defined meta-data for the media; the metadata can be defined in the mediadetail page (by the user) or in the API (by the developer).
In the FileInfo Component, its values can be read as: media.metadata.user.<key>

Examples of keys are
  • 'synopsis' - read as: media.metadata.user.synopsis
  • 'pin' - read as:
media.ofilesizeThe total size of all transcoded versions of this file, including thumbnails in bytes.
media.publicUrlThe base-url associated with the file. See below for more information.
media.ratingThe average rating. This is a floating point number between 0 and 10. 2 decimals are provided.
media.statusThe status of the file. Generally this is always 3, meaning 'succesfully converted'.
media.moderationStatusThe moderation status of the file.
media.titleThe title of the file.
media.tagsA space delimited list of tags associated with the file. For example "amsterdam holiday".
media.uidThe id of the user who uploaded the file.
media.updownratingThis template variable will give you the "thumbs up/down" rating. The actual formula is actually based on the votecount and average rating, and assumes people rate 0 for down, and 10 for up.
media.uploadThe date and time the file was added to the Media Factory.
media.uploadageThe time that has passed since the file was uploaded. The format will be for example 5 seconds, 20 minutes or 12 days.
media.user_cityThe submitter's city.
media.user_countryThe submitter's 2-letter country code.
media.user_firstnameThe submitter's first name.
media.user_lastnameThe submitter's last name.
media.user_nameThe username of the person uploading the file.
media.user_nicknameThe submitter's nickname.
media.user_stateThe 2-letter state or province code of the submitter.
media.votecountThe total number of votes cast.
media.widthThe width of the original file in pixels.
media.geo_latitudeThe latitude of the file if available, otherwise empty.
media.geo_longitudeThe longitude of the file if available, otherwise empty.
media.authorThis field is used to retrieve the name entered by an anonymous user. Often used when users can comment without registering, by a captcha.
media.conversionsThis is an array of conversions and their status. eg. media.conversions.15 will return 3 if converted successfully

See also

More Examples:

Example 2:

The following code shows the title and metadata for a media with the mid being specified by {$$get.mid}.

<fm:FileInfo mid="{$$get.mid}" > Title: <b>{$$media.title}</b><br /> Rating <b>{$$media.rating}</b><br /> Metadata User Synopsis <b> {$$media.metadata.user.synopsis} </b><br /> Metadata User Pin <b> {$$} </b><br /> </fm:FileInfo>