From: Ken D. <ken...@sy...> - 2001-01-26 01:27:53
|
Correction, $fileName var below was corrected but still doesn't work. I realize now that the jpeg photo should be ASN encoded first, is that correct? Ken At 03:08 PM 01/25/2001 -0700, Ken DeLay wrote: >Excuse a newbie question, but I am trying to do something simple and add an entry >to a Netscape Directory via perl-ldap with a jpeg photo. > >The problem I am having is that the jpeg photo doesn't seem to get added correctly. > >I am using the same basic sample code from the Mozilla FAQ: > >$filename="test.jpg"; >if (-e $fileName) { > open(JPEG, $fileName) || die; > while (sysread JPEG, $buf, 1024) { > $jpegimage .= $buf; > > } > } else { > open(JPEG, $NOPHOTOJPG) || die; > $jpegimage=<JPEG>; > while (sysread JPEG, $buf, 1024) { > $jpegimage .= $buf; > } > } > $entry->{jpegphoto} = $jpegimage; > >Anyone had problems using this code to add binary data such as a jpeg photo >to the Netscape 4.1 directory server? > > >Thanks, > >Ken > > >========================= >Ken DeLay >Senior Consultant >Syntegra (USA) >Phone: (303)-205-1621 >email: ken...@sy... >========================= > |