Avatar of QuiAO
Flag for Norway

asked on 

How can I add jpegphoto mages to LDAP with PHP?

I have created a script for adding information about a user to LDAP.
I have a folder with jpg-images, and I want to upload them to the LDAP-server.

I have written a base64_encode function, like this:


function encodeImage($imgfile) {
      $imgbinary = fread(fopen($imgfile, "r"), filesize($imgfile));
      return (base64_encode($imgbinary));

But it does not work, beacuse LDAP does not like the output of this function...?

I hav to implement this to an existing system, so it have to be written in PHP.

Does anybody have some tricks for me?

btw, if I write some other info, for instance "TEST" to the field, it works... So LDAP connection with php working fine.

Avatar of undefined
Last Comment

8/22/2022 - Mon