php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1429 Unable to retreive jpeg image-data from Directory using LDAP
Submitted: 1999-05-20 10:33 UTC Modified: 1999-12-13 16:06 UTC
From: kenson at sentor dot se Assigned:
Status: Closed Package: Other
PHP Version: 3.0.7 OS: FreeBSD 4.0-CURRENT
Private report: No CVE-ID: None
 [1999-05-20 10:33 UTC] kenson at sentor dot se
I use this little snippet of code to retreive a jpeg image from the directory.
(I know all the data goes through to the client side since I traced it)
--CODE--
   $sr=ldap_read($ds,"$dnpic","jpegphoto=*",array("jpegphoto"));
   $info = ldap_get_entries($ds, $sr);
   Header("Content-type: image/jpeg");
   echo $info[0]["jpegphoto"][0];
   $f = fopen("/tmp/fil.jpg","w");
   fwrite($f,$info[0]["jpegphoto"][0]);
--CODE--

The file /tmp/fil.jpg will contain all bytes in the image up til the first NULL byte occurence where it is cut off. Using ldap_search() with appropriate params yields the same result. And I have tested to retreive the image
using LDAP command-line clients - works fine.

My php is --with-apache, --with-mysql, --with-ldap, --with-imap
LDAP: RCS Version: $Id: ldap.c,v 1.66 1999/02/01 02:31:10 sas Exp $

Nothing relevant in my php3.ini

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 09:52 UTC] sas at cvs dot php dot net
Did you store the image data in base64 format or in binary format? I'm not sure whether the whole involved code is binary clean (since you mentioned the NUL byte).
 [1999-12-13 16:06 UTC] joey at cvs dot php dot net
closing. Lack of info
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 19:01:29 2024 UTC