TheInsider
Programmer
Hi,
I have a SQL Server database that stores pictures in a table. I have an applet that must retrieve certain images based on certain conditions. For security reason I do not want the applet to have direct access to the database (i.e. connection info), but rather have an ASP page control the selection of the image something like:
This works fine when embedding the above into an HTML page like
; however, Java doesn't seem to allow the loading of an Image from an ASP page using getImage(). I even tried removing the
portion of the ASP page, so that the returned stream was 100% pure jpg image data, but that didn't work either. I also tried retrieving the ASP output stream into a byte array and then using createImage(), but haven't had any success with that approach thus far (I just get garbage painted onto the canvas). Unfortunately, I don't have my code in front of me right now or I would paste what I have, but this really shouldn't be that difficult to do... I'm just fairly new to Java.
Thanks in advance,
The Insider
I have a SQL Server database that stores pictures in a table. I have an applet that must retrieve certain images based on certain conditions. For security reason I do not want the applet to have direct access to the database (i.e. connection info), but rather have an ASP page control the selection of the image something like:
Code:
<%
Response.ContentType = "image/jpeg"
Response.BinaryWrite Recordset("MyPicture")
%>
Code:
<img src="PicLoader.asp">
Code:
Response.ContentType = "image/jpeg"
Thanks in advance,
The Insider