Skip Navigation Links
Home
+
About
+
Products
+
Support
+
Purchase
+
Search
+
AddFromFile (Method of LDAPAttributeCollection)
Insert a new attribute into the directory using the contents of a file as the value.
Syntax
AddFromFile(AttributeName As String, Filename As String) As LDAPAttribute
Remarks
The AddFromFile method creates a new attribute. It uses the contents of a file to create the first value for this newly-created attribute. The contents of the file are treated as binary data, and therefore no UTF-8 character translation is performed. The entire contents of the specified file are loaded into memory when this method is called.
Example
Set pLDAP = CreateObject("LDAPClient.3")
Call pLDAP.Connect("ldapserver")
Set pEntries = pLDAP.Search("o=airius.com", "uid=bjensen")

' Add Bab's image to her entry
Call pEntries(0).Attributes.AddFromFile("jpegPhoto", "c:\BabsImage.jpg")