Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Trent Grandey 22 posts 143 karma points
    May 08, 2019 @ 01:52
    Trent Grandey
    0

    Configuration For Media Filenames

    I'm trying to change the file name handling when uploading media. It is currently changing all filenames to lowercase and it has some default handling for special characters, like replacing spaces/underscores/dashes.

    Looking in the source code at the DefaultShortStringHelper class, it seems that most of these options are configurable for each culture. Specifically, I'm looking at this section in the contructor:

    .WithConfig(CleanStringType.FileName, new Config
                {
                    PreFilter = ApplyUrlReplaceCharacters,
                    IsTerm = (c, leading) => char.IsLetterOrDigit(c) || c == '_', // letter, digit or underscore
                    StringType = CleanStringType.Utf8 | CleanStringType.LowerCase,
                    BreakTermsOnUpper = false,
                    Separator = '-'
                })
    

    It is defaulting to LowerCase. I (my client) would prefer Pascal Case for their filenames. I can see how I can change it in the source code, but I'm wondering if there is an option to edit this in the configuration files so I don't have to change the source code.

    Thanks for any help!

    Trent

Please Sign in or register to post replies

Write your reply to:

Draft