Lotus Notes FAQ Visit Our Sponsor!

How do you detach a file submitted by a web browser?

The attachment comes in as a Notes V2 attachment. The following code would extract the attachment into a file named "file.web":

  Dim Item as NotesItem
  Dim Object as NotesEmbeddedObject
  Dim Doc as NotesDocument
  Set Item = Doc.GetFirstItem("$FILE")
  Dim ItemName As String
  ItemName = Item.Values(0)
  Set Object = Doc.GetAttachment(ItemName)
  Call Object.ExtractFile("file.web")

If you need to extract multiple items:

  Forall Item In Doc.Items
    If (Item.Name = "$FILE") Then
      ' Process one item
    End If
  End Forall

If you need to check whether any of these are in a Rich Text field, use the NotesRichTextItem's GetEmbeddedObject method or look in the EmbeddedObjects property of the NotesRichTextItem.

Applies to Notes Versions: 4 4.5 4.6 5
Last Modified: September 8, 1999