Hello, if you make use of the servlet then you can solve your problem by simply making use of the code below:
Code:
DataOutput Out = new DataOutputStream (res.getOutputStream ());
res.setContentType ( "image / jpeg");
String img = request.getParameter ( "imageName");
File filename = null;
FileInputStream in = null;
String filenamePath = img.replace ("/", "\ \");
filename = new File (filenamePath);
if (File.Exists ())
return;
in = new FileInputStream (filename);
res.setContentLength ((int) filename.length ());
byte value [] = new byte [4096];
int number;
while ((number = in.read (value))! = -1)
{
Out.Write (value, 0, number);
}
in.close ();
Bookmarks