Need suggestion about Image storage
Hi Guys,
I am having a JPEG Image in remote location.
I am downloading this as below
private byte[] getImageBytes(String imageURL) throws Exception
{
URL url = null;
URLConnection urlConn = null;
InputStreamReader inStream = null;
url = new URL(imageURL);
urlConn = url.openConnection();
inStream = new InputStreamReader(urlConn.getInputStream());
return IOUtils.toByteArray(inStream);
}
and than storing that in a sql server database.
At the point of displaying that image. I am using a servlet and returning file as content type image/jpeg.
however when I showing that Image in browser by hitting servlet image is all blurred and displayed image is different from orignal iamge.
I am not sure if it is becoz of storing Image as blob , or setting up worng content type.
Please suggest.
Thanks
Priyanka

