Thank you for your answers. Using base64 unit and loading the jpg into a string 
list then encodestringbase64 gets the job done. Now the image uploads to ldap 
but slighty corrupted. I think that stringlist.loadfromfile is not the way to 
go. I must read the jpeg in another way. Any ideeas?
Thank you all.


Sent from Samsung Mobile

<div>-------- Original message --------</div><div>From: Daniel Donoghue 
<d...@revelationtv.com> </div><div>Date:11/03/2014  11:45  (GMT+02:00) 
</div><div>To: Ararat Synapse <synalist-public@lists.sourceforge.net> 
</div><div>Subject: Re: [Synalist] LDAPSend binary atachment - jpegPhoto 
</div><div>
</div>Marius,

If you're working on Linux you can use the ldapsearch tool to look at all your 
objects and see what is returned from the directory. Im sure there are 
equivalent tools on windows.

Unfortunately im not in front of my laptop right now or I'd give you some 
examples

With every blessing,
-
Daniel Donoghue
From: Marius Dalacu
Sent: ‎11/‎03/‎2014 10:01
To: Ararat Synapse
Subject: Re: [Synalist] LDAPSend binary atachment - jpegPhoto

Thank you for your reply, the reading part is working perfectly.

This is the code that i am using:

ldapAttrib.Clear;
ldap.SearchCookie:='';
ldap.Search(userDN, False, '(objectclass=*)', ldapAttrib);
if ldap.SearchResult.Count = 1 then
  begin

  for i := 0 to ldap.SearchResult[0].Attributes.Count-1 do
    begin

      case ldap.SearchResult[0].Attributes[i].AttributeName of
        'sAMAccountName' :

        'jpegPhoto' :
           begin
             MS:=TMemoryStream.Create;
             ldap.SearchResult[0].Attributes.Items[i].SaveToStream(MS);
             MS.Seek(0,0);
            Image1.Picture.LoadFromStream(MS);
            MS.Free;

         end

   end;

So, i think that the jpegPhoto attribute is not encoded, it is the raw jpeg 
(unless the decoding is done transparently by ldapsend).

What else can i do, how to investigate? Why is the difference in size when i 
load from file and save to file from attr recodrd?

Thank you very much.

On 2014-03-11 9:44, Lukas Gebauer wrote:

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.
Please, try to reas some existing Jpeg from the LDAP and see, how it 
is encoded. Maybe it is encoded as Base64.





-- 
Lukas Gebauer.

http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib.
http://geoget.ararat.cz/ - Geocaching solution


------------------------------------------------------------------------------
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
 

 
------------------------------------------------------------------------------
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

Reply via email to