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
    Jun 08, 2011 @ 10:33
    Bex
    0

    Setting upload property on document programatically

    Hello!

    My minds gone blank and I can't work out how to do this!

    I have created a document type with numerous properties, one of which is an upload.
    I am creating a new document and setting these properties programatically, but I can't work out how I need to set the upload value.

     

      Document myNewDocument = new Document(nodeId);
      myNewDocument.getProperty("prop1").Value = "value1";
      myNewDocument.getProperty("prop2").Value = "value2";
      myNewDocument.getProperty("prop3").Value = "value3";
      myNewDocument.getProperty("prop4").Value = "value4"; myNewDocument.getProperty("upload").Value = ??????????

    Do I need to make a new media item like:

    Media.MakeNew(.......

    and then assign the media Id to it?

    or do I need to upload it somewhere and assign a path?

    If so where?

    Or does it need doing a different way?

    Thanks for any help!

     

    Bex

     

     

  • Bex 444 posts 555 karma points
    Jun 08, 2011 @ 12:50
    Bex
    0

    Finally after much searching I have found a post that tells me how:

    http://our.umbraco.org/forum/developers/api-questions/6503-Upload-datatype-member-uploading-image

Please Sign in or register to post replies

Write your reply to:

Draft