Hi,
Am trying to extract an image from a URL as follows:
The URL is a valid one. But still I get the following error :
Any idea where I am going wrong ?
Thanks for any help ..
Am trying to extract an image from a URL as follows:
Code:
try
{
BufferedImage input = ImageIO.read(new URL("http://www.google.co.in/images/close_sm.gif"));
File outputFile = new File("image.png");
ImageIO.write(input, "PNG", outputFile);
}
catch(Exception e)
{
System.out.println(e);
}
Code:
javax.imageio.IIOException: Can't get input stream from URL!
Thanks for any help ..
Comment