before this would return the location of the file on the filesysterm, however now the GetProperty("umbracoFile") is null
Has this property been removed? if so, how does one now get the file server location for a media item? Or maybe it is just a case of after update it is not in the cache, but there is no way to publish meida items like for other content?
In the example above the media picker has a propertyAlias called imgId, and the piece of code check if there are set an image in the page that you are viwing in the browser.
Thanks for your reply Dennis .. I have just managed to fix it now after rebuilding the indexes on the Examine Management tab of the Developer section and it works again, so I think it was just an issue of the upgrade process, but maybe this will help someone else one time.
umbracoFile media property in Umbraco 7
Having just about upgraded from v6 to v7.1.8, I have a bit of code not working,
umbraco.MacroEngines.DynamicNode media = new umbraco.MacroEngines.DynamicNode(imgId);
string imageURL = media.GetProperty("umbracoFile").Value.ToString();
before this would return the location of the file on the filesysterm, however now the GetProperty("umbracoFile") is null
Has this property been removed? if so, how does one now get the file server location for a media item? Or maybe it is just a case of after update it is not in the cache, but there is no way to publish meida items like for other content?
Thanks
Tom
Hi Tom
If you are using the media picker, you should be able to do something like this:
In the example above the media picker has a propertyAlias called imgId, and the piece of code check if there are set an image in the page that you are viwing in the browser.
You can find the documentation here jf you just select single images, and see the strongly typed version: http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors/Media-Picker
If you want to select multiple image take a look here: http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7/Media-Picker
Hope this helps,
/Dennis
Thanks for your reply Dennis .. I have just managed to fix it now after rebuilding the indexes on the Examine Management tab of the Developer section and it works again, so I think it was just an issue of the upgrade process, but maybe this will help someone else one time.
is working on a reply...