Files Are Content

Last Updated: Mar 29, 2022
documentation for the dotCMS Content Management System

When you create a new file, whether a dotAsset or a FileAsset, you are actually creating a new piece of content.

Treating files as content provides a number of benefits:

  • You can create new file Content Types.
  • You can customize fields on each file Content Type.
  • You may use all normal content tools on files, including taxonomies, the REST API, relationships and pulling files with Lucene queries.
  • You can apply different Workflows to each file Content Type.
    • For example, your photos and document libraries can have different Workflows.
  • Files are URL addressable binary files with all the benefits of being content.
  • Files have CDN friendly pathing for image manipulation with no query strings.

Adding Fields to a File Content Type

Since files are content, you can add fields to a file content type in the same way you add fields to any other content type.

Note that when adding or editing fields to a file Content Type, by default the Metadata field is in a separate tab (below a Tab Divider field). So if you wish to add a new field that will display on the first tab in the content editing screen, make sure to add the newly created field above the Metadata field.

Bulk File Operations

Although files can be created, updated, customized, and manipulated in the same ways as content, files are unique that there are several ways to upload multiple files at the same time (in “bulk”) without the user entering specific values for each field in the file, such as:

  • Uploading multiple files at the same time from the Site Browser.
  • Dragging-and-dropping multiple dotAssets into the Content Search screen.
  • Uploading and managing File Assets using WebDAV.

Because of this, it is important that the values of all custom fields on file Content Types can be set automatically, so appropriate values can be assigned when files are uploaded in bulk. This means that for any custom field on a file content type one of the following should be true:

  • It should not be a Required field, OR
  • It should Have a Default value set.

If you have a Required field on a file Content Type which does not have a default value for the field, you will not be able to upload files of that Content Type in bulk. This is true even for the default File Asset and dotAsset Content Types included with the starter site, so it's important that if you add any custom fields to these default file Content Types, you configure them appropriately to allow bulk uploads.

On this page

×

We Dig Feedback

Selected excerpt:

×