In the previous example we showed how to add metadata to an existing file. In this example we'll retrieve some of the data we saved.



First we'll need a variable containing the URL to our image and another containing the path to the file.

theURL = "images/boat.jpg"
thePath = Server.MapPath(theURL)


Next we get the metadata back from the image. First we create a File object and open the existing caption metadata. Then we copy the text of the metadata into our title variable.

Set theFile = Server.CreateObject("MetaFiler2.File")
Set theMetaData = theFile.Open("title")
theTitle = theMetaData.Text



Finally we write out some HTML to show the image and the title.

Response.Write "<img src=" & theURL & "><br>"
Response.Write Server.HTMLEncode(theTitle)