Copied to clipboard

Flag this post as spam?

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


  • slawekg 9 posts 29 karma points
    Oct 02, 2009 @ 16:48
    slawekg
    0

    NiceUrl for Media file?

    I have a Page with Media coupled with it by MediaPicker (so I have both Page node id and media file id). Can I somehow have some impact on the url to media? NiceUrl doesn't seem to work (returns empty). The media gets url like: site.com/media/987/file.pdf. I would like it to be for example: site.com/file.pdf . Is messing with the URL rewrite the only way to achieve that?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 02, 2009 @ 16:55
    Aaron Powell
    0

    you would need to use a URL rewriter to achieve this. Umbraco will always store the ID of the media element as part of the path (either a folder or in the file name), otherwise how could you ensure uniqueness across the site?

    If file.pdf was in the root and someone else tried to upload a file called file.pdf it would replace the existing one and 'update' all links to it.

  • slawekg 9 posts 29 karma points
    Oct 03, 2009 @ 14:52
    slawekg
    0

    Look, I know you want to help me, but, with all the respect, you didn't said anything new.

    It's obvious that cms has to somehow find the file. It's obvious that id needs to be used. I am aware of that. I am also aware of implications that could have on existing files put outside the media.

    I asked a question whether it's possible to have impact on that without url rewrite and the answer isn't that obvious. That's because umbraco has several undocumented features and hacks and that could be one of them.

    Thanks for help anyway.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 04, 2009 @ 09:27
    Dirk De Grave
    0

    slawekg,

    I've not done/tried this myself, but you could try to add a new property to your media item with alias = umbracoUrlAlias or alias = umbracoUrlName. I know it works for content items, so it might also work on media items (I wouldn't know why atm)

    More info can be found on the wiki

     

    Hope this helps.

    Cheers,

    /Dirk

  • slawekg 9 posts 29 karma points
    Oct 05, 2009 @ 13:26
    slawekg
    0

    Nope, that doesn't seem to work. Thanks for help anyway.

Please Sign in or register to post replies

Write your reply to:

Draft