Skip to content

Restrict upload to specific file types

The file upload dialog now offers a configuration option that allows only files with permitted extensions to be uploaded.

By default, the OpenCms upload dialog accepts any file type, including formats like videos (.mp4 etc.), which tend to be very large and are often not meant to be uploaded.

With the new configuration option, you can now define a whitelist of allowed file extensions. This makes it possible to restrict uploads to the desired file types.

The list of file extensions is configured using the sitemap attribute “upload.extensions”. If the sitemap attribute is set, only files with the specified extensions are allowed to be uploaded. Multiple permitted extensions can be specified by separating them with commas: “png,jpg,pdf”. Specifying “*” allows all extensions.