hi i have a problem reated to image retrieval what i did till now i have a column in data base with blob data type I can easily upload the image with the help of FormFile and BinaryStream but when i try to retrieve that image i face some sort of problem My problem is:--
I got the image in the resultset with the help of connection but its return type is InputStream which doesnt have the write method so that i can not write that image in the jsp page
if i didnt use InputStream and i use byte array and then try to print it again it will not print with no error so i cant not understand why this problem occurs thanks alot
You're going to have to "write" the image to a file, and include the path to that file from your page. Try writing to a file first, once you get that you'll see that all you need to do then is include the path to this within an image tag.
Additionally, you might want to check this forum form more on I/O issues.
close the OutputStream and if this is a Struts Action, return a null forward
in your jsp, use src="myAction.do" in your <img> tag
In the Struts 1.2.x download, the struts-examples.war file that comes with the download contains an example of how to do this. Look for org.apache.struts.webapp.exercise.ImageAction [ October 19, 2005: Message edited by: Merrill Higginson ]