File assets

Use the File asset to upload files into Matrix. Use this asset if a specific file type asset does not exist. For example, if you were uploading a Microsoft Word document, you would use the Microsoft Word document asset instead of the file asset.

Adding a file

When you add a new file, the following fields are available:

Title

The name for the file asset. This field will be used as the file’s friendly name and will appear in the asset tree. This name will also appear wherever the keyword replacement %asset_short_name% is used.

Upload file

Select which file to upload as the file from your computer. Filename lengths are limited to 240 characters.

To determine which assets in the system have a hyperlink to a file, look at the Linking screen. The Current Linking section lists assets linked to the file.

Details screen

The Details screen for a file lets you set up this asset.

Read Asset details screen for more information about the status, future status, and thumbnail sections of this screen.

Details

This section lets you change the files' details, including the title and which file to use. The available fields are:

Title

The title (asset short name) of the file. By default, the value initially entered into the title field appears in this field.

Filename

The filename of the uploaded file. By default, the uploaded file name appears in this field.

Upload file

This field lets you upload a new version of the file. Filename lengths are limited to 240 characters.

Current file

This section outlines the files' details, including the size of the file and when it was last updated. If you click on the Current file link, a preview of the file will appear in a new window.

If you have selected a new file to upload using the Upload file field, this file’s details will not appear in the current file section until you save the screen.
Allow unrestricted access

Depending on what this setting is, the file’s status, and whether public read access has been granted, Matrix will use different URL formats.

Yes

If the status of the file is Under construction and public read access has been granted, then an asset tree relative URL is used. For example, http://www.example.com/resources/documents/report.pdf, where resources/documents are the parent assets of the file in the asset tree. This format means that it is served dynamically from the Matrix repository and is not optimal in terms of performance.

However, if the file’s status is live and public read access has been granted, then a static URL is used—for example, http://www.example.com/__data/assets/pdf/100/report.pdf where 100 is the asset id of the file. This static URL provides optimal performance. It is served directly by the web server and does not have to get processed by Matrix.

No

If this setting is No, then the asset tree relative URL is used. This setting may be required if an external system is referencing the file and needs to use the relative URL, for example, for robots.txt files.

The default setting of the Allow unrestricted access field is Yes.

File asset types

There are other specific file type assets with very similar functionality in addition to the generic file asset. These file type settings are useful instead of the generic asset. They control which type of file can be uploaded against the asset.

They are also useful for when you want to implement search pages or asset listings that specifically target certain file types. Some of these asset types also have additional functionality that supports their specific file type.

The documentation on this page will only refer to the additional functionality available for each file asset type. To read about the generic functionality of file type assets, refer to the previous chapter.

Audio file

An audio file asset is used to upload web-compatible audio files and supports the following file extensions:

  • .mp3

  • .mka

  • .m4a

  • .aac

  • .ogg

  • .webm

  • .wav

  • .flac

ID3 tag information

The Details screen of this asset includes a section for adding additional information against the file. The top of this section has two fields for extracting and writing ID3 metadata:

Extract ID3 metadata

Enable this to extract any metadata from the audio file to apply to the asset.

Write ID3 metadata to file

Enable this field to write any metadata from the audio asset to apply to the audio file.

CSS file

A CSS file asset is used to upload and edit CSS files and supports the following file extensions:

  • .css

  • .scss

JS file

A JS file asset is used to upload and edit javascript files and supports the following file extensions:

  • .js

Microsoft Excel document

A Microsoft Excel document asset is used to upload microsoft excel documents and supports the following file extensions:

  • .xls

  • .xlt

  • .xlsx

  • .xlsm

  • .xltx

  • .xltm

Microsoft Powerpoint document

A Microsoft Powerpoint document asset is used to upload microsoft power point documents and supports the following file extensions:

  • .ppt

  • .pot

  • .pps

  • .pptx

  • .potx

  • .ppsx

  • .pptm

  • .potm

  • .ppsm

Microsoft Word document

A Microsoft Word document asset is used to upload microsoft word documents and supports the following file extensions:

  • .doc

  • .dot

  • .docx

  • .docm

  • .dotx

  • .dotm

PDF file

A PDF file asset is used to upload PDF documents and supports the following file extensions:

  • .pdf

RTF file

An RTF file asset is used to upload RTF files and supports the following file extensions:

  • .rtf

Text file

A text file asset is used to upload text files and supports the following file extensions:

  • .txt

Video file

A video file asset is used to upload video based files and supports the following file extensions:

  • .mov

  • .avi

  • .wmv

  • .asf

  • .flv

  • .mp4

  • .m4v

  • .mpg

  • .mpeg

  • .ogv

  • .ogg

  • .webm

Video metadata

The Details screen of this asset includes a section for adding additional information against the file. The top of this section includes an option called Extract video metadata. Enable this to extract any metadata from the file to apply to the asset.

XML file

An XML file asset is used to upload XML (extensible markup language) files and supports the following file extensions:

  • .xml

Transformations screen

This screen lets you specify an XSL file to use for the XML file’s extensible style sheet language styling when previewing the asset.

This option requires PHP to have XSL support supplied in your system. If your system runs on Debian, you will be required to install the php5-xsl package on your system.

The transformations section lets you select the XSL file to use for XSL transformation.

The following fields are available:

XSL transformation

Select an XSL file to use and select Save. This XSL file is used to stylize the content of the XML file. This style will be reflected when previewing the asset on the frontend.

Replace global keywords

If set to Yes, global keywords in the XSL file will be replaced when applying to the XML data.

Text-based file asset types

The text-based file asset types include:

  • CSS file

  • JS file

  • Text file

  • XML file

  • XSL file

Creating without uploading a file

Text-based file asset types allow you to create them without needing to upload an existing file first. Enter a title for the file and select Save. This action will create an empty text file of that type.

Edit file screen

Text-based files allow you to edit them directly within Matrix. You can edit the contents of these files on their Edit file screen. Uploading a new file from the Details screen will overwrite and custom edits you have made on the Edit file screen.

GetID3 metadata extraction

Some file types allow for automatic metadata extraction of the physical file when uploaded against the asset. Use this function with the getID3 external tool, which must be enabled for automatic metadata extraction to work.

Read External tools configuration for more information on enabling the getID3 tool.

Metadata is automatically extracted and applied to the additional fields if the tool is enabled when a file asset with metadata extraction support is created.