getMedia function returns weird path Options
jessie.cheong
Posted: Tuesday, October 16, 2007 2:14:41 PM
Rank: Enthusiast

Joined: 9/23/2007
Posts: 18
I have the following function:

Code:

private string GetLogoPath(string mediaid)
        {
            string returnpath = "";

            //do the logic for return path
            Int32 theID = 0;
            theID = Int32.Parse(mediaid);
            XPathNodeIterator theNode = umbraco.library.GetMedia(theID, false);           
            returnpath = theNode.Current.Value;           
            return returnpath;
        }


It does return a path but unfortunately the path is abit weird, it seems to attach some other number values to it, can anyone please advise how to get it to return the correct value??

WARNING: Might ask stupid question or give stupid answer
drobar
Posted: Tuesday, October 16, 2007 3:12:46 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Hi, Jess,

Check out this post for how to get the various pieces you're looking for...

http://forum.umbraco.org/15011

cheers,
doug.

MVP 2007-2009 - Percipient Studios
jessie.cheong
Posted: Tuesday, October 16, 2007 4:36:57 PM
Rank: Enthusiast

Joined: 9/23/2007
Posts: 18
Hi,
Found another solution. Another way to stab at it is using the following:

Code:

private string GetTenantLogoPath(string mediaid)
        {
            string returnpath = "";           
            Int32 theID = 0;
            theID = Int32.Parse(mediaid);
            umbraco.cms.businesslogic.media.Media m = new umbraco.cms.businesslogic.media.Media(theID);
            returnpath = Convert.ToString(m.getProperty("umbracoFile").Value);     
            return returnpath;
        }



WARNING: Might ask stupid question or give stupid answer
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.