Copied to clipboard

Flag this post as spam?

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


  • Sherry Ann Hernandez 320 posts 344 karma points
    Jun 09, 2011 @ 13:24
    Sherry Ann Hernandez
    0

    how do I check if media folder is existing.

    Is there a way to check if the media folder is existing? because I want to add the media folder whenever I add a document content.

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Jun 10, 2011 @ 21:45
    Bo Damgaard Mortensen
    0

    Hi Sherry,

    I'd recommend you to install the uComponents package by Lee Kelleher. This package's got some neat methods when working with Media items. In your case you could do something like this (untested code):

    List<Media> results = GetMediaByName("YourDocumentName");
    if(results.Count > 0)
    {
        // You have a match
    }
    else
    {
        // There's no Media folder with that name
    }

    Let me know if it works :-)

    Thanks,

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft