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

[924 byte] By [PriyankaChaurishia123a] at [2007-11-27 7:52:49]
# 1
Hi Priyanka,Before directly storing into database some real path is to be mentioned as I am doing in Eclipse.
redangera at 2007-7-12 19:34:02 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...