Avatar of QuiAO
QuiAO
Flag for Norway

asked on 

How can I add jpegphoto mages to LDAP with PHP?

Hi,
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:


<?php

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

Avatar of undefined
Last Comment
perezjos

8/22/2022 - Mon