U4-10905 - CMS truncate/warning on long filenames

Created by Shannon Deminick 30 Jan 2018, 18:23:35 Updated by Jacob Midtgaard-Olesen 05 Feb 2018, 10:51:34

Subtask of: U4-9609

We need to have a configuration option to limit the length of file names. Should just be a setting in the umbracoSettings.config file.

This is to ensure that people do not upload files with really long names and then try to deploy these files to environments that have different root path lengths which will then cause an exception about file lengths.

We can have an option to truncate the file name if the max path is exceeded, and/or to warn the user. Perhaps it is easiest to truncate and then display a warning if that occurred.


Claus Jensen 05 Feb 2018, 07:37:43

Not really sure how we can fix this best, as it seems the problem is not really the filename. It is the complete (full) file path ''including the filename''.

It means that the check isn't really to just check for a specific filename length - as this can vary a lot depending on which environment we're on.

Also .. keep in mind, we can't really do this check by simply "testing" the full filepath-length, as in many cases you would be uploading files on a local environment and then pushing this content/media to the next environment being on Cloud. The upload would work fine on local since it most likely doesn't run in a site having a path with several guids combined. As soon as you try to push this content to a Cloud site, it would fail since the full paths are now way too long.

We can of course go for a solution where we just (on Cloud sites) set this to a ''really'' low value to ensure it should always work... but I'm not sure if that would be viable?

Shannon Deminick 05 Feb 2018, 08:28:21

Yes i understand, which is why we have a configurable max length value. For example, we will have a better idea on Cloud how long a file name can be because we roughly know how long the base path is.

Priority: Normal

Type: Task

State: Open


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:


Story Points: 3

Cycle: 8