Copied to clipboard

Flag this post as spam?

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


  • Sergio 73 posts 93 karma points
    Dec 09, 2011 @ 12:10
    Sergio
    0

    GetMediaByUrlName How does it work? Or any other method to get media using the path?

    I´m using the XSLExtensions from the UComponents dll but I can´t get the Media Items using this method:

    uComponents.Core.XsltExtensions.Media.GetMediaByUrlName

    I have tried with all the formats:

    • "http://server/media/file.ext"
    • "/media/file.ext"
    • "media/file.ext"

    But always returns the full Media Items, not only the desired node.

    Exactly what I need is the size of the media item, to render it.

    Anybody can help?

  • Sergio 73 posts 93 karma points
    Dec 09, 2011 @ 12:20
    Sergio
    0

    I have checked in the XML that in the URLName attribute it comes only the name of the media, so I can´t use this method to get a media item from his path.

    Any idea about how to do this in C#?

  • Sergio 73 posts 93 karma points
    Dec 09, 2011 @ 12:39
    Sergio
    0

    I don´t know if there´s a better way but I have decided to get the ID parsing the URL. It´s always the last folder.

    Once I have the Media ID I can´t use the umbraco.library.GetMedia method.

Please Sign in or register to post replies

Write your reply to:

Draft