The Uploadify flash content and everything else seems to be embedded correctly, and I'm able to browse files and start the upload. But whenever I've selected the files to be uploaded i get a messagebox saying "An error occurred: No node exists with id '0'". The point where this error happens, is before the first file is uploaded, but after the file size is checked, as i still get the "File Size Error" for files above the Web.config max.
The uploader works just fine when used in the Media section as a property in the Folder type, so its not an installation option.
Is there something I'm missing when adding the macro like this? I'd probably be looking into the source code for this answer if it were available, but as this is not the case, I sincerely hope some of you may help.
I think you have a problem with the target media folder. Can you test an upload in Firefox and check what gets sent to "Uploadify.ashx" when uploading? There should be a "mediaFolder" parameter in there, what's the value?
The value of mediaFolder seems to be 0, which is in accordance to the error message. I'm pretty sure, though, that I'm adding the right node id to the macro using "mcr.MacroAttributes.Add("MediaFolder", imageBrowserMediaNodeId);" as i check the validity of the id before i add the macro to the property control. Is there some other way to add this mediaFolder id?
This works because items in the Attributes hashtable is added to the MacroAttributes before the Control is rendered. Why it didn't work with the MacroAttributes table, I don't know, but my guess is its due to incorrect typecasting of the value object. I might try and do a ToString() on the value added to MacroAttributes, just to see if that would have solve my trouble.
But thank you Emanuel for pointing me in the right direction and for a great uploadify package.
- NIkolaj
Edit: It didn't work with adding ToString and use the MacroAttributes hashtable, but the first solution still works, so Attributes is the way to go.
Using uploadify macro on a custom dashboard
I'm trying to embed Gecko Uploadify on a custom dashboard by inserting the macro into a control like this:
umbraco.presentation.templateControls.Macro mcr = new umbraco.presentation.templateControls.Macro();
mcr.Alias = "GeckoUploadify";
mcr.MacroAttributes.Add("MediaFolder", imageUploadProperty);
mcr.MacroAttributes.Add("AllowedTypes", "*.jpg|*.png|.gif");
imageUploadProperty.Controls.Add(mcr);
The Uploadify flash content and everything else seems to be embedded correctly, and I'm able to browse files and start the upload. But whenever I've selected the files to be uploaded i get a messagebox saying "An error occurred: No node exists with id '0'". The point where this error happens, is before the first file is uploaded, but after the file size is checked, as i still get the "File Size Error" for files above the Web.config max.
The uploader works just fine when used in the Media section as a property in the Folder type, so its not an installation option.
Is there something I'm missing when adding the macro like this? I'd probably be looking into the source code for this answer if it were available, but as this is not the case, I sincerely hope some of you may help.
Thanks in advance.
- Nikolaj
Hi,
I think you have a problem with the target media folder.
Can you test an upload in Firefox and check what gets sent to "Uploadify.ashx" when uploading? There should be a "mediaFolder" parameter in there, what's the value?
I'm not sure if this is what you mean, but here is some of the jQuery script concerning the .ashx file and a mediaFolder parameter:
The Uploadify.ascx usercontrol has a public int MediaFolder { get; set; } that is rendered directly on the page.
The fact that you're seeing a "mediaFolder: 0" means somehow the binding isn't happening, i.e., the MediaFolder property is 0.
Perhaps you're not calling the MacroAttributed.Add method in the right time, try changing it to Init, Load, PreRender...
I made it work now after having a look at the Macro class in the Umbraco source.
I changed
mcr.MacroAttributes.Add("MediaFolder", imageBrowserMediaNodeId);
to
mcr.Attributes.Add("MediaFolder", imageBrowserMediaNodeId.ToString());
This works because items in the Attributes hashtable is added to the MacroAttributes before the Control is rendered.
Why it didn't work with the MacroAttributes table, I don't know, but my guess is its due to incorrect typecasting of the value object.
I might try and do a ToString() on the value added to MacroAttributes, just to see if that would have solve my trouble.
But thank you Emanuel for pointing me in the right direction and for a great uploadify package.
- NIkolaj
Edit: It didn't work with adding ToString and use the MacroAttributes hashtable, but the first solution still works, so Attributes is the way to go.
is working on a reply...