Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Mar 29, 2010 @ 15:46
    Rik Helsen
    0

    Media URL's don't parse characters the same way as pages do?

    I noticed today that when we have characters in urls (spaces, é, à è etc) that these aren't translated as they would be in a page url.

    Is there a way to fix this as it breaks all the links that we place to a document in the media section?

    Second, in the properties of a media item, we can change it's name, but not it's filename, does this mean we can't change it without uploading it again?

    Kind regards,

    Rik

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Mar 29, 2010 @ 17:08
    Sebastiaan Janssen
    0

    There is a way, but it involves writing your own eventhandler. In the AfterSave event you could detect and rewrite these characters, you can also rename the file on disk.

    You wouldn't have to re-upload everything, but you will need to hit save on all of these items.

    This really is only a problem when there's an ampersand (&) in the filename, URL's are allowed to have special characters in them, but when there's an ampersand, it looks like a URL parameter of course. You could try doing an umbraco.library:UrlEncode() on the media file, but I don't think I had much luck with that.

  • David Dupont 61 posts 115 karma points
    Aug 20, 2010 @ 12:24
    David Dupont
    0

    Not only the ampersand but ' caracters too.

    Indeed when you try to bind a file that contains one in the RTE. It will break the JS script.

  • Rik Helsen 670 posts 873 karma points
    Aug 24, 2010 @ 10:28
  • David Dupont 61 posts 115 karma points
    Oct 25, 2010 @ 12:02
    David Dupont
    0

    Thanks Rik,

    I've added a vote on it.
    On the other side I've written an event handler on Media.AfterSave as Sebastiaan was suggesting and everything is OK now.

Please Sign in or register to post replies

Write your reply to:

Draft