Copied to clipboard

Flag this post as spam?

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


  • Bex 444 posts 555 karma points
    Jul 21, 2010 @ 11:11
    Bex
    0

    Get media Folder By Name or Get All Media Folders

    Hi

    I need to be able to get a Media folder by it's name, before you say use the ID I can't as the Media folders are automatically generated so I don't know the Ids.

    I have a list of folders as follows 

    Media
    ---Folder1
    ---Folder2
    ---Folder3


    There doesn't seem to be a function available to do this and I can't work out how to get at the XML.
    I have tried Media.GetRootMedias() but is returns an "object not set..."
    Can anyone help?

    Bex

  • Bex 444 posts 555 karma points
    Jul 21, 2010 @ 11:24
    Bex
    0

    Forgot to say above (and can't update it) I am using umbraco 4.0.3

     

    Another Update..

    I thought I'd create a root folder.. and put all the other folders in it so I could call this and and then loop its children, but there appears to be a problem.
    My media folderId is: 1673, So I am going Media rootMediaFolder = new Media(1673), and I get object not set.

    If I try Library.GetMedia(1673) I get no results..! 

    What am I doing wrong?

Please Sign in or register to post replies

Write your reply to:

Draft