|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-08-25 06:05 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 15:00:01 2025 UTC |
Hi! Just tried to put an image into LDAP directory. ---code--- <? $con=ldap_connect("server",389); $bind=ldap_bind($con); $fp=fopen("/path/file.jpg","r"); $image=fread($fp,filesize("/path/file.jpg")); fclose($fp); $entry[jpegPhoto]=base64_encode($image); $r=ldap_modify($con,"cn=someone,o=bla,c=de",$entry); c=ldap_close($con); ?> ---/code--- This one produces a new (or modified) entry of type jpegPhoto in the directory, but Netscape(4.7) LDAP-client can't read the image. I use OpenLDAP on the server. an "ldif -b jpegPhoto \ <file.jpg >testldif" produces a base64-encoded image. When i insert this image into directory, everything is OK and Netscape displays the right thing. A quick look at the page source results: ldif and base64_encode() produce different code. Question is: why? and: how ca i insert a jpeg into LDAP using php3? Package vesions: Apache 1.3.9 php3 3.0.16 built through DSO with: LDAP,IMAP,GD,MySQL,Postgres,Informix,PDFLib,CLibPDF, Calendar,XML (all dynamic loading) (mail me for SRPM) OpenLDAP 1.2.9 (as of RH 6.2) RedHat Linux 6.2 (Kernel 2.2.14)