adding binary attribute using python-ldap

Rahul Amaram amaramrahul at gmail.com
Wed Mar 19 19:54:17 CET 2008


Hi Michael,
Thanks for the response. I think I found the reason for the error. It seems
to be necessary to append ";binary" to the attribute name while
adding/modifying binary attributes. So for instance if I am
adding/modifying userCertificate, I will have to use the attribute name
"userCertificate;binary". Else you are likely to get an undefined attribute
/ binary transfer failed error.

Regards,
Rahul.

On Wed, 19 Mar 2008 19:01:25 +0100, Michael Ströder <michael at stroeder.com>
wrote:
> Rahul Amaram wrote:
>> I was wondering if there is any way I can add binary data (such as
>> jpegPhoto and userCertificate) using python-ldap. I've googled but
>> coudn't find any solution. If there is no way of doing it, what is the
>> best alternative solution?
> 
> There's simply no difference. Note that normal strings are binary buffers
> in
> Python 2.x anyway. Since python-ldap does not treat Unicode objects
> differently at the moment any attribute value passed to a LDAPObject
> method
> is passed on in LDAP requests as is.
> 
> Ciao, Michael.



More information about the python-ldap mailing list