I am trying to retrieve jpegPhotos from my openldap directory with Net::Ldap, however I keep getting files containing only "data" and not a jpeg files.
I took inspiration from:
http://search.cpan.org/src/GBARR/perl-ldap-0.31/contrib/jpegDisplay.pl
here's the section of code I took:
$photo=$entry->get_attribute( 'jpegPhoto' );
if(ref($photo))
{$picture = @$photo[0];}
else
{print "\n";
print "No jpegPhoto attribute for DN: $dn\n";}
open (TMP, ">./photos/$mail");
$| = 1;
print TMP $picture;
close(TMP);$ file photos/[EMAIL PROTECTED] photos/[EMAIL PROTECTED]: data which cannot be viewed as a jpeg photo :-(
What I am doing wrong ?
