Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to save an image with set of data i.e ( image title, location of image, person who took the photo , ..so on)
I hope to save these data in image 'porpertycollection ' like follows:
IMedia newImage =_mediaService.CreateMedia(imageName, parentFolderId, "Image");
is above method possible?
if so how to create custom PropertyType.
else how to store those values related to image.
Add new properties on the existing media type "Image" (simple textstring properties will do). As soon as you upload a new image, those new properties will be available. Same as if you'd create the new media using your code.
Be aware that changing the structure of the existing media type "Image" will impact all images (don't have to supply values for all existing images though).
Could also create a new media type (copy from the existing one) and add the new properties there (in which case you don't change existing images in media section)
More info on creating new media types can be found here: https://our.umbraco.com/documentation/Getting-Started/Data/Creating-Media/#creating-a-media-type
thank you for the idea.
but my situation force me to store data related to image in umbraco backend.
and i have to extend mediaType programmatically
See https://our.umbraco.com/documentation/Reference/Management/Services/ContentTypeService/ on how to extend media type programmatically
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted