Hi 
On Monday 29 March 2004 14:09, jehan.procaccia wrote:
> Hello,
> 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 ?

have you tried to copy/rename the file an open it in an image viewer ?
Maybe the magic file (the one that defines the file derermination criteria for 
file) is not good enough to detect this special case,

Peter

-- 
Peter Marschall
eMail: [EMAIL PROTECTED]

Reply via email to