Copied to clipboard

Flag this post as spam?

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


  • jake williamson 207 posts 873 karma points
    Sep 25, 2014 @ 18:51
    jake williamson
    0

    where is the media xml stored? doesn't appear to be in 'umbraco.config'?

    hi out there,

    i've been tasked with downloading all the media items in an umbraco site (they're going into a new umbraco site, but that's another story...).

    i can find the node id's of all of the media items in where used in content in the 'umbraco.config' file generated by the site.

    but i can't find cosponsoring media based on the node id in the 'umbraco.config'...

    ...which makes me think it comes from somewhere else? just can't find where?!

    any one know - i'm really hoping it won't be the database...

    cheers,

    jake

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 25, 2014 @ 19:22
    Dennis Aaen
    0

    Hi Jake

    The images in your Umbraco installation are save as physical files on the disk and located in the folder called Media in your Umbraco installation file system on the disk.

    In the Media folder you will find a folder for every image that you have upload in the Umbraco backoffice these folders are created by Umbraco automatically. But when you should move images to a new Umbraco installation you should copy the Media folder in your file system for your new your Umbraco installation.

    Hope this helps. If you have further questions keep asking

    /Dennis

  • jake williamson 207 posts 873 karma points
    Sep 26, 2014 @ 10:15
    jake williamson
    0

    hi dennis,

    thanks for getting back to me, appreciate it.

    totally get the physical media location, that all makes complete sense. the bit i'm trying to get is the xml that's returned by this:

    var helper = new UmbracoHelper(UmbracoContext.Current);
    var item = helper.TypedMedia(id);
    

    which contains all the properties for the media item.

    it's a bit complicated, but the task i have is to take an old umbraco 6 site and convert the content using the doctypes into a new umbraco 7 site, converting the content again to new doctypes and tidying up the media as i go.

    at the moment, i'm opening the 'umbraco.config' as a xml file, then using XDocument to query the xml using linq (which works a treat!).

    this is a snip of the xml i'm getting back:

    <Destination id="1264" parentID="1122" level="4" writerID="4" creatorID="0" nodeType="1049" template="1050" sortOrder="1" createDate="2011-11-10T14:52:28" updateDate="2013-10-15T15:02:53" nodeName="Corsica" urlName="corsica" writerName="asd" creatorName="asd" path="-1,1104,1105,1122,1264" isDoc="">
    <metaDescription><![CDATA[]]></metaDescription>
    <metaKeywords />
    <heroImage1>1418</heroImage1>
    <title>Corsica</title>
    <databaseId>16</databaseId>
    <mapDestinationShow>1</mapDestinationShow>
    <mapDestination>Corsica</mapDestination>
    <bodyText><![CDATA[]]></bodyText>
    <heroImage2>1417</heroImage2>
    <heroImage3>1419</heroImage3>
    <keyFacts><![CDATA[]]></keyFacts>
    <mapDestinationLat>42.054143</mapDestinationLat>
    <mapDestinationLon>9.046954</mapDestinationLon>
    <climate><![CDATA[]]></climate>
    <heroImage4>1420</heroImage4>
    <heroImage5>1421</heroImage5>
    <mapDestinationUrl>//corsica.aspx</mapDestinationUrl>
    <mapImage>1392</mapImage>
    <heroImage6>1422</heroImage6>
    <mapDestinationPointer><![CDATA[Up]]></mapDestinationPointer>
    <heroImage7 />
    <mapDestinationWeight>2</mapDestinationWeight>
    <heroImage8 />
    <heroImage9 />
    <heroImage10 />
    </Destination>
    

    i'm looking at the (1 through 10)

    <heroImage1>1418</heroImage1>
    

    nodes and the id's correspond to the media item node id's.

    i spose i could use the 'TypedMedia(id)' call to get the media item but it'd be really good to know where this is coming from? it's seems odd if a database hit is taking place when the content is coming from the xml?

    cheers,

    jake

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Sep 26, 2014 @ 12:05
    Chriztian Steinmeier
    0

    Hi Jake,

    I'm not familiar with the TypedMedia() method, but I'm assuming from your question that it's roughly the same as the GetMedia() extension in umbraco.library, which we use a lot in XSLT.

    The GetMedia() method allows specifying that you want to fetch all childnodes as well, which means that if you specify the ID of a top-level folder in Media, you should be able to get an XML document with all the media items in and below that folder.

    You can then do whatever you need to map the IDs from your Content XML to those in the Media XML.

    (I've done something very similar to this a couple of years now at Christmas, to generate the 24 Days In Umbraco EPUBs :-)

    /Chriztian

  • jake williamson 207 posts 873 karma points
    Sep 26, 2014 @ 15:57
    jake williamson
    0

    thanks for the replys chaps ;)

    think i've found what i'm after though... the 'cmsContentXml' table in the database contains the media nodes! for example:

    <Image id="1111" parentID="1110" level="3" creatorID="0" sortOrder="1" createDate="2011-10-19T16:06:56" updateDate="2011-10-19T16:06:56" nodeName="asd" urlName="asd" path="-1,1063,1110,1111" isDoc="" nodeType="1032" writerName="asd" writerID="0" version="06ca276a-31cf-4ea1-82e9-83817ce6bff5" template="0" nodeTypeAlias="Image">
    

    this means i can take a back up of that table and use it in conjunction with the 'umbraco.config' to get the content and media.\

    now all i gotta do is write the converter...

    cheers,

    jake

Please Sign in or register to post replies

Write your reply to:

Draft