Link to home
Start Free TrialLog in
Avatar of cgray1223
cgray1223

asked on

How to expose Blob (Image) data via REST webservice

Hello,

I'm storing images in blob form in a MySql database table. I need to expose these images via a REST webservices and was wondering what my options are. The main option I see is to read the database, create the image and store it on the filesystem and send the path to the image in the REST response. Any other ideas here? I'm thinking I will use RESTeasy for my JAX-RS implementation. Thanks for the help!
Avatar of Mick Barry
Mick Barry
Flag of Australia image

you shouldn't need to store it to file. for example the following shows how to return an image using a servlet http://helpdesk.objects.com.au/java/how-can-i-return-an-image-using-a-servlet
So you would map the appropriate path to something that returns the image
Avatar of cgray1223
cgray1223

ASKER

Thanks for the suggestion objects.  One other complication is the the consumer of the webservice needs to receive other data with the request, they're not just displaying the image.  They need to do some flash transformations on the image using the data coming in from the xml.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial