Content hub configuration

The content hub is a centralized location where you can manage and distribute your content. It provides a way for content editors to create, store, manage, and publish content across multiple channels.

This page covers content hub configuration options you can use to customize your project:

Customize maximum file upload size and chunk size

The system allows you to configure the maximum size of a single file that is allowed in the content hub and the size of chunks that large files are broken into during chunk upload.

The default values are:

  • 100 MB maximum file size
  • 10 MB chunk size

To customize the values:

  1. Open your Xperience project in Visual Studio and edit the Program.cs file.

  2. Call the Configure<FileUploadOptions> method of the IServiceColletion and specify the FileUploadOptions properties.

    
    
     using CMS.Base.Configuration;
    
     var builder = WebApplication.CreateBuilder(args);
    
     builder.Services.Configure<FileUploadOptions>(options =>
     {
         // Sets the maximum file size to 500 MB
         options.MaxFileSize = 524288000L;
         // Sets the chunk size to 20 MB
         options.ChunkSize = 20971520;
     });
    
     

Chunk upload

Chunk upload is a process of uploading large files to a server in smaller pieces, or chunks, rather than all at once. This is a useful technique for uploading very large files, such as high-resolution videos or large software packages, where the file size may exceed the user’s available bandwidth.

Chunk upload works by breaking a large file into smaller pieces and uploading them one at a time. Once all the chunks have been uploaded, the server can reassemble them into the original file.

Customize supported file types

The content hub supports the following types of images: bmpgifpngjpgjpegtifftif, webp. These types of image files are supported by default.

The system detects audio and video files based on their MIME type (audio types starting with the audio/ prefix and video types starting with the video/ prefix). For successfully detecting audio and video file types, the system renders appropriate HTML5 markup. The types of files that can be previewed or played depend on the web browser (modern HTML5 web browsers typically support one or more of the oggmp4, or webm video codecs, and mp3wav, or ogg audio codecs).

All other file types (e.g., docx, pdf, odt, vector graphic formats) are recognized as documents. You can still store them in the content hub and link them to content items.

If you want to configure the system to allow the upload of a custom file type into the content hub, you need to:

  1. Enable the custom extensions to be uploaded to the content hub.
  2. (Optional) If you want to use the custom extension as an image file, you need to configure the system to recognize the extension as an image file.

Customize allowed extensions

To customize the set of file types that can be uploaded into the content hub:

  1. Open the Settings application.
  2. Navigate to the Content → Assets category.
  3. Add the selected file extensions into the Asset allowed extensions setting in the Security section (separated by semicolons).
  4. Save the changes.

Specify image file types

By default, the system can recognize and process any media type if you have the right player for the given file type. Custom file types can be recognized as image files via configuration keys. However, by specifying allowed file types, you disable the automatic detection and support for media file types other than those explicitly added via your configuration.

To allow media files of specified types to be recognized as image files, add the CMSImageExtensions key to your application’s configuration file (appsettings.json by default).



"CMSImageExtensions": "bmp;gif;ico;png;wmf;jpg;jpeg;tiff;tif;webp"

Files of the specified types are now recognized as image files and will be, for example, offered in the Insert image dialog of the rich text editor.