dcsimg
Sending image and retrieving image through a servlet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Naveen_Varma
Posted On:   Thursday, August 21, 2003 08:15 AM

I want to send an image from a client to a servlet which will store it in mySQL database and another to retrieve it .Can any one provide me some code to do that or some hints to do that?

Re: Sending image and retrieving image through a servlet

Posted By:   Marc_hermann  
Posted On:   Friday, August 22, 2003 04:21 AM

First you have to build a servlet page which lets you gain access to your filesystem. I think thereĀ“s a javascript or html - method that can do that.

Next, you have to pass the selected value (the path) to your servlet, than gain access via FileInputStream.

Next you pass this fileinputstream to the database (Blob).


The other way round :

you gain access to the DB, retrieve the Data via getBinaryStream or so (look jdbc for the correct method) and pass it over to an arrayfield. This you can save to your harddisk via Fileinputstream.


Sorry for my bad english ;-)
About | Sitemap | Contact