Copied to clipboard

Flag this post as spam?

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


  • Klaus 47 posts 67 karma points
    Dec 21, 2011 @ 00:16
    Klaus
    0

    Associate images with a document - how to?

    Hello,

    I would like to associate images uploaded with Uploadify to an new Document in Umbraco. I have a finished user control that creates the document, but i'm not sure how to make the match between the doc and the images.

    My guess is that when i upload the files i send the media ID to my create document usercontrol - then it (the document ) holds a reference to the image(s).

    Please let me know what you are thinking?

    //Klaus

  • Emanuel 63 posts 283 karma points
    Dec 21, 2011 @ 11:36
    Emanuel
    0

    Hi Klaus,

    I think I understand what you need. You need a way of "triggering" some code when a file is uploaded using Uploadify.
    In that regard, I've created a new version of the DLL with a "FileSaved" event. You can attach to that event and run your custom code whenever a file is saved in Umbraco.

    Please don't confuse it with the "FileUploaded", which happens *before* the file is saved (and enables you to, for instance, cancel the upload if some condition isn't met).

    Let me know if the "FileSaved" works. If it does, I'll release a new version with that DLL.
    File available here: http://www.mediafire.com/?72z2ayh4499np4o

    Cheers,
    Emanuel

  • Klaus 47 posts 67 karma points
    Dec 21, 2011 @ 12:07
    Klaus
    0

    Hi,

    When Uploadify uploads the images to Umbraco, is it then posible to get/ return the mediaFolderId that has been created by Umbraco? I guess it is umbraco that handles the creation of new folders and the naming?

    I think i need to add a property to my Documents that is called MediaFolderId that associates the Document to the images.

     

    //Klaus

  • Emanuel 63 posts 283 karma points
    Dec 21, 2011 @ 12:16
    Emanuel
    0

    Hi Klaus,

    As I said, have a play with the FileSaved event I created especially for you. The event argument should have a "Media" property that will give you access to the newly-created Media item. If you navigate to Media.Parent.Id, you'll get the folder ID where the file was added to.

  • Klaus 47 posts 67 karma points
    Dec 21, 2011 @ 12:25
    Klaus
    0

    Hi, 

    That's really kind of you - I appriciate. I will take a look at it. Im a newbee in programming, but i will see what i can get out of it.

    I will be back with a comment on it.

     

    /thanks again

Please Sign in or register to post replies

Write your reply to:

Draft