Copied to clipboard

Flag this post as spam?

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


  • Fergus Davidson 309 posts 588 karma points
    May 05, 2010 @ 13:20
    Fergus Davidson
    0

    get media from file name - is it possible

    hi

    is it possible to identify a media item from it's filename ie umbracoFile property??

     

  • Chris Dunn 210 posts 401 karma points
    May 05, 2010 @ 15:15
    Chris Dunn
    0

    If you already know the filename why do you need the media item?  Maybe if you explain more about what you're trying to do.

    You could probably do it with a custom xslt extension, but I am not aware of an existing function.

    -Chris

  • Thomas Höhler 1237 posts 1709 karma points MVP
    May 05, 2010 @ 15:16
    Thomas Höhler
    0

    Therefore that the two media items can have the same filename or umbracoFile property it isn't possible to be sure that you have the correct media. If you have the folder in which the media file is located (eg /media/1234/myfile.jpg) then you have the id of the property. where you can iterate through all medias to search for this id. Otherwise you can iterate through all medias and try to identify the media by the umbracoFile property. But as I said you can't be sure to get the correct media.

    hth, Thomas

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies