Copied to clipboard

Flag this post as spam?

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


  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 22, 2015 @ 08:22
    Rune Grønkjær
    0

    Why does Umbraco remove parentheses from uploaded files?

    Hi Guys,

    Does anyone know why Umbraco removes e.g. parentheses from filenames when they are uploaded to media?

    As far as I know they are not illegal and I cannot find any config settings to change this behavior. Can I change it?

    I have a customer for which the parentheses are very important in the file names.

    Thanks /Rune

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 22, 2015 @ 09:37
    Douglas Robar
    0

    I haven't looked into this myself but a few thoughts and things you might try are below.

    I assume you mean that the url to a file loses the parentheses? Which, I suppose, means the filename itself was altered upon upload since the umbracoFile property is the filename and needs to be sanitized to be url-safe.

    For content nodes, there are url-replacements for "special" characters. These used to all listed in the /config/umbracosettings.config file. But since few people ever changed them they were moved out of the file with a comment left behind.

    Might be this is also used for media filenames on upload? That's what I'm not sure about. It would be worth a quick try though.

    Details on urlReplacing at https://our.umbraco.org/documentation/reference/config/umbracosettings/ and in the comments of the /config/umbracosettings.config file.

    Though currently the ( and ) characters aren't included by default now they once were (they were removed from urls back then) so if you have an older or upgraded site maybe you're finding that lingering behaviour?

    As a quick test, try using this to force keeping them:

    <char org="(">(</char>  
    <char org=")">)</char>
    

    cheers,
    doug.

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 22, 2015 @ 09:59
    Rune Grønkjær
    0

    Good idea, but it did not work.

    No change at all. The file name is still missing (). It is an Umbraco 6.1 site, but I can see that 6.2 and 7.2 does the same thing.

    /Rune

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 22, 2015 @ 10:00
    Douglas Robar
    0

    Thanks for trying!

    Guess it'll take a look into the source code to see why this is happening then, and if there is a way to change the behaviour short of a change in the code.

    cheers,
    doug.

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 22, 2015 @ 11:51
    Rune Grønkjær
    0

    Cheers Doug. Hope you find something good :)

    /Rune

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 22, 2015 @ 12:02
    Douglas Robar
    0

    Actually, I was kinda bailing out and was sort of hoping you'd dig in and let us know what you found in the code. :)

    Or maybe someone else knows the answer off the top of their head?

    cheers,
    doug.

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 22, 2015 @ 13:23
    Rune Grønkjær
    0

    Aaah, of course. I misread (Will mark your "answer" as spam now ;P)

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 22, 2015 @ 13:24
    Douglas Robar
    0

    @Rune :D

  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Oct 22, 2015 @ 13:23
    Ravi Motha
    0

    Its not a link validity thing like the fact urls are not supposed to have ( ) in them??

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 22, 2015 @ 13:25
    Douglas Robar
    0

    @Ravi - There's no problem with parentheses in urls, they are included in the 'safe' list.

  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Oct 22, 2015 @ 13:39
    Ravi Motha
    0

    fair enough, we were having a similar conversation around link validity, but if the issue is with parenthesis as I have now reread ( I bizarrely read it square brackets or curly braces not parentheses).. then I'm not sure

    any way carry on

Please Sign in or register to post replies

Write your reply to:

Draft