Dain:

Thanks for the info, however this does seem to work. I try to access the
picture via the ldap protocol:

ldap://law-ldap.georgetown.edu/uid=batesm,%20ou=Specials,%20o=Georgetown.EDU
,c=US?jpegphoto

and in Netscape it shows ok. However, if I try to directly link to it in a
template like:

<img
src="ldap://law-ldap.georgetown.edu/uid=batesm,%20ou=Specials,%20o=Georgetow
n.EDU,c=US?jpegphoto">

it does not work.

Also, your suggestion to use the 2-step approach below does not seem to be
bringing any results (broken link to image). It is also kind of hard to
debug. If I try to output the photo result that I get back from the LDAP
directory is only 5 characters, which if I try to TOBASE64 I get the first
few characters of the image.

I guess either the LDAP tag does not return the whole image (only the 1st 5
characters), or there is a manipulation or a step somewhere that I am
missing.

Can anybody help me with that? I posted this to forums.allaire.com but
nobody has responded there yet either.

Thanks in advance,
Dimo Michailov



----- Original Message -----
From: "Dain Anderson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, June 02, 2001 10:36 AM
Subject: Re: LDAP and binary files


> Dimitar,
>
> You could try something like the following, which requires two steps. The
> first page uses a .cfm file as the source of an image, passing it the
user's
> 'uid' value. The second page (the one that queries the LDAP server) uses
> CFCONTENT and the query result to form the proper MIME type of
'image/jpeg'
> that gets returned to Page1.cfm.
>
> As a note, some jpegs use the image/pjpeg MIME type (photoshop).
>
> Page1.cfm:
>
> <img src="ldap.cfm?uid=#userid#">
>
> Ldap.cfm:
>
> <cfldap action="QUERY" name="Test" attributes="uid,
> mail,guradiusprofile,jpegphoto" start="ou=Specials, o=University.EDU,c=US"
> scope="SUBTREE" filter="(uid=#url.uid#)" server="ldap.university.edu">
>
> <cfcontent type="image/jpeg">
> #Test.jpegphoto#
>
> Dain Anderson
> Caretaker, CF Comet
> http://www.cfcomet.com/
>
>
> ----- Original Message -----
> From: "Dimitar Michailov" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Friday, June 01, 2001 1:23 PM
> Subject: LDAP and binary files
>
>
> > Hello everybody:
> >
> > I have been going through the archives but with no success....
> >
> > I need to query a LDAP directory for a user and show their picture. I
> > execute the LDAP query but I am not able to show the picture information
> > (JPEG file).
> >
> > <cfldap action="QUERY" name="Test" attributes="uid,
> > mail,guradiusprofile,jpegphoto" start="ou=Specials,
o=University.EDU,c=US"
> > scope="SUBTREE" filter="(uid=userid)" server="ldap.university.edu">
> >
> >
> > Then, if I try to output the JPEGPHOTO all I see on the screen is 'ÿØÿà'
> > which, if I try to TOBINARY() I get the first 5 characters of the image
> > file.
> >
> > The problem and the question is - why I am getting only the first 5
> > characters (in TOBASE64 format) of the JPEG image. Am I missing
something?
> >
> > Thanks for the help.
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to