Re: Java Newbie... Read file at HTTP



How do you mean *load*?
If you want an image:

BufferedImage bi = ImageIO.read(urlForXYZ.com);
you then have the image.

If you need just a file over HTTP:

URL image = new URL(urlForXYZ.com, pic.jpg);
URLConnection con = getImages.openConnection();
con.setDoInput(true);
con.setUseCaches(false);
InputStream stream = con.getInputStream();
....
	do something with the stream
stream.close();
con.close();


sven.dz@xxxxxxxxx wrote:
Hi,

I need the code for "loading" a picture over www (ex.
http://www.xyz.com/pic.jpg). I need only to load it, I do not need to
save it on my disk or something like that... Sounds useless and it
is... But I want to learn it and I need it :-)

Greetings


-- http://lloyd-duke.net + news AT website.domain .