Copied to clipboard

Flag this post as spam?

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


  • Kevin Walker 66 posts 87 karma points
    Feb 28, 2013 @ 12:19
    Kevin Walker
    0

    Umbraco Media Picker Get Image Path

    Given that database calls are minimised in Umbraco using the umbraco.config files. Is there anyway when using the 'Media Picker' as a document property on the document type, that you can retrieve the path to this image without hitting the database? How come only the media item node Id is stored in the Umbraco config and not the path to the image upon publishing? I do most of my node work back end to create objects based on the document type using c# and I have been using GetMedia or code such as the following (below), is there another way I am unaware of to get the path to the image without it hitting the DB? Cheers

    var media = new umbraco.cms.businesslogic.media.Media(nodeId);

     var file = media.getProperty("umbracoFile");

    ReviewThumbnailImage = file.Value.ToString();

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 28, 2013 @ 12:28
    Jeroen Breuer
    0

    You can find more info here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia

    You could also try DAMP. It can store the complete media in the umbraco.config xml.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft