This example shows how to add textual metadata to an existing file.

 

   
Setup
 
     

We'll assume that we're working with a picture of a boat and that we have a caption and a title we want to associate with it. Just to ease the process we'll set up variables containing the path to our image, the caption and title text.

thePath = Server.MapPath("images/boat.jpg")
theTitle = "Boat & Buoy"
theCaption = "Buoy maintenance in the Indian Ocean"

   
Adding
 
     

Next we create a MetaFiler File object. We add the metadata to the file object and then we put our title into the text property of the metadata. We then repeat the process for the caption.

Set theFile = Server.CreateObject("MetaFiler2.File")
theFile.SetFile(thePath)
Set theMetaData = theFile.Add("title")
theMetaData.Text = theTitle
Set theMetaData = theFile.Add("caption")
theMetaData.Text = theCaption