From: Mark W. <mew...@un...> - 2000-11-08 22:54:33
|
$entry->get(..) returns an array context. Thus you would need to do something like $image->[0] to get the actual value. If you're using the latest version of Net::LDAP, use $entry->get_value(..) this will return the first value of the array if called in a scalar context. Mark On Wed, 8 Nov 2000, Cary Z wrote: > Hi, All, > > I am trying to work out image processing in LDAP using Perl-Ldap. I used the > following code to save the image into the database. > ################################## > open (in, "<clinton.jpg") or die "$@"; > $imagedata = <in>; > close(in); > $result = $ldap->modify($entry, add => {'jpegphoto' => $imagedata}); > ################################## > > After that, when I dump the content of the attributes, I found the jpegphoto > attribute(which was not there before). So I assume it's ok. > > Then I used this to retrieve it: > ################################## > $image = $entry->get('jpegphoto'); > print "Content-type: image/jpeg\n\n"; > print $image; > ################################## > > However I got this when the browser should only give me an image: > > ARRAY(0X2BE0B8) > > Could some one point me a way out. Thanks in advance. > > - CZ - > |