Hi, i have successfully used ldapsend to browse my AD and to add small
attributes. Now i want to add the jpegPhoto attribute to some users but
i am facing a lot of problems.
This is the code that i use:
PROCEDURE ADDPHOTO;
VAR
AATTR:TLDAPATTRIBUTE;
BEGIN
IF OPENDIALOG1.EXECUTE THEN
BEGIN
AATTR:=TLDAPATTRIBUTE.CREATE;
TRY
AATTR.ATTRIBUTENAME:='JPEGPHOTO;BINARY';
AATTR.LOADFROMFILE(OPENDIALOG1.FILENAME);
//AATTR.SAVETOFILE(OPENDIALOG1.FILENAME+'.JPG');
SHOWMESSAGE(BOOLTOSTR(LDAP.MODIFY(LDAP.SEARCHRESULT[0].OBJECTNAME,MO_REPLACE,AATTR),TRUE));
FINALLY
AATTR.FREE;
END;
END;
END;
The problem is that the ldap throws an error when i try with
LoadFromFile method. If i uncoment the line (savtofile) and compare it
with the loaded one the content id different, also by size any jpej that
i throw at it only saves 5450 bytes !?.
If i use aAttr.Add method with a string containing the jpeg the ldap
does not show an error, it saves something but with a tottaly corrupted
content also smaller in size.
What is the proper way to add jpegPhoto attribute. Is something wrong
with my code or is a library bug somewhere?
Thank you very much for this library and i hope someone will enlighten
me.
Marius Dalacu.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public