QuiAO
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.
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.
What LDAP server? This what attribute you are trying to write this information? What error is being returned when you are trying to upload this value?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
good to close for me thanks
Jose
Jose