As far as the first question it depends on the LDAP directory. We use Oracle
Internet Directory which has a great Java API for accessing the Directory.


as far as displaying an image once it's recieved I wrote a servlet called
GetImage which connects to the LDAP Directory and retrieves the image then
simply sets the return type of the output stream to "image/jpg" and pipes
output of the image retrieval to the servlets output stream. Any HTML or jsp
page which needs an image from the Directory uses the following code

<img src="/getImage?fileName=SomeName"> thus instead of the image src making
a direct link to the image it calls the servlet which gets the image and
outputs it in the correct format.

-----Original Message-----
From: Roland Dong [mailto:rdong@;CAIT.ORG]
Sent: Tuesday, October 22, 2002 3:54 PM
To: [EMAIL PROTECTED]
Subject: How to retrieve jpeg image file from LDAP?


I am working on a project which retrieves jpeg image files and heave them
displayed in the browser.

These jpeg photos are stored as base64 in LDAP server.
I am using JSP for this project.

My questions are

1. How do I retrieve images from LDAP using jsp? I know how to retrieve any
data of string type.
2. How do I decode them back into binary and display them?

Any examples?


Thanks a lot

RD

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to