This example shows how to iterate through all the metadata in a file.

 

   
Setup
 
     

First we'll need a path for our file. We then create a File object and assign the path to the object.

thePath = Server.MapPath("images/boat.jpg")
Set theFile = Server.CreateObject("MetaFiler2.File")
theFile.SetFile(thePath)

 

   
Display
 
     

Next we go through every metadata type listed for the file and open each one so that we can return the data to the web page.

For Each theType In theFile.Types
  Set theData = theFile.Open(theType)
  theText = Server.HTMLEncode(theData.Text)

  Response.Write "Type = " & theType & "<br>"
  Response.Write "Text = " & theText & "<br><br>"
Next

   
Result
 
     

This is an example of the kind of output you might expect.

Type = title
Text = Boat & Buoy

Type = caption
Text = Buoy maintenance in the Indian Ocean