Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    Oct 11, 2017 @ 00:40
    Pete
    0

    Media url's

    Does anyone know where the url is stored directly in the DB for media objects ?

    I can see the ID e.g 1309 in the propertyData table, but I can't see the full url /media/etc...

    Thanks

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Oct 11, 2017 @ 08:30
    Marc Goodson
    102

    Hi Pete

    In the cmsPropertyData table, there will be a row containing the data for the umbracoFile alias for each media item (umbracoFile is the default you probably won't have changed that)

    If you run the following SQL

    SELECT [id]
          ,[contentNodeId]
          ,[versionId]
          ,[propertytypeid]
          ,[dataInt]
          ,[dataDate]
          ,[dataNvarchar]
          ,[dataNtext]
      FROM [dbo].[cmsPropertyData]
      where propertytypeid in (Select id from cmsPropertyType where alias = 'umbracoFile')
    

    You should see all of the saved property values for all of your umbracoFile properties.

    If you are using the Image Cropper, the media path will be stored inside a JSON blob within the dataNtext field eg:

    {src: '/media/2553/yourimage.jpg', crops: [
      {
        "width": 858,
        "height": 267,
        "alias": "HomepageBanner"
      },
      {
        "alias": "SiteBanner",
        "width": 750,
        "height": 233
      },
      {
        "width": 192,
        "height": 139,
        "alias": "SiteButton"
      },
      {
        "alias": "SiteBtn",
        "width": 145,
        "height": 64
      }
    ]}
    

    If you are not using the Image Cropper then the path will be stored in the dataNvarchar field:

    /media/2553/yourimage.jpg

    regards

    Marc

  • Pete 213 posts 285 karma points
    Oct 11, 2017 @ 11:57
    Pete
    0

    Thanks marc i'll give that a go.

Please Sign in or register to post replies

Write your reply to:

Draft