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).
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).
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.
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.
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
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
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
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.
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
is working on a reply...