Image properties "Author" and "Description"

Vote:
 

Hello,

I am a newbie in Episerver, I have made an import from "Digimaker CMS" to "Episerver". 

I found the "Author" and "Description" properties are empty.

How can I update their values?

I have an XML file with all the values I need to add. for example

<Image ID="10520" Author="myAuthor" Description ="myDescription" Width="100" Height="740" Path="Pictures\miljojournalistene_10520_GK1T41.gif" />

My plan is :

1) Read the xml file image by image

2) pick the file name of the image and locate it in  Episerver.

3) Update its Author and Description values.

Could you please correct me?

Thanks in advance

#65833
Feb 11, 2013 20:23
Vote:
 

The format of metadata fields of files in EPiServer is defined in FileSummary.config in your website root.

What you need to do is to modify the file summary of each uploaded file. Basically something like this:

var file = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile("mypath/myfile.jpg") as UnifiedFile;
file.Summary.Author = "John Connor"; // All fields defined in FileSummary.config will appear as properties of Summary.
// You can define custom fields by adding to the Dictionary property like this:
file.Summary.Dictionary["MyCustomField"] = "Gangnam Style";


Try these blog posts on the FileSummary.config file and how to work with it:

  • http://www.frederikvig.com/2010/04/episerver-file-manager-and-file-summary/
  • http://blog.fredrikhaglund.se/blog/2008/01/07/storing-metadata-attached-to-uploaded-files/ (written for CMS 5 but still valid for CMS 6 I think)
 
#65858
Edited, Feb 12, 2013 13:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.