troubleshooting Question

How can I add jpegphoto mages to LDAP with PHP?

Avatar of QuiAO
QuiAOFlag for Norway asked on
3 Comments1 Solution1212 ViewsLast Modified:
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.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros