Copied to clipboard

Flag this post as spam?

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


  • Nigel Wilson 945 posts 2077 karma points
    Sep 04, 2012 @ 23:51
    Nigel Wilson
    0

    Media ID's of Media Items and Folder Names

    Hey

    Just had a thought and maybe I am missing something here.

    When creating a media item it gets assigned an ID, being the Id from the database table.

    Just wondering why the actual folder created within the media directory couldn't be the same as the media ID from the database table. 

    The reason for asking is that I have just built a web service for content delivery and replicating media items. It would be soooo much simpler if you knew the folder name in the media section was the same as the ID of the media item in the dB table.

    Any thoughts / clarification as to why they aren't the same ?

    Cheers, nigel

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 06, 2012 @ 17:43
    Tom Fulton
    0

    I don't know the exact thought process behind the naming of the media folders, but I do know that they're named by the property ID.  Perhaps they did this to avoid name conflicts if you have two upload fields on a doc/media type - this way they can both have files uploaded with the same name since they'll be in different folders based on their property id.

    Also, not sure if this helps you or not, but this is a helper method I've used a while back to get a Media item based on it's file path.  GetMediaByPath

    -Tom

    UPDATE:  looks like a more generic method was added to uComponents 4.1.0:  http://ucomponents.codeplex.com/SourceControl/changeset/f74faf78951d

     

Please Sign in or register to post replies

Write your reply to:

Draft