| Author |
Upload an HTML file along with images contained in that page
|
Muhammed Akhtar Hossain
Greenhorn
Joined: Jun 11, 2003
Posts: 2
|
|
Hi/ I would like to copy an html file to a particular destination and also all the images contained in that file. Can u please help me how can I find the image names(paths) from the html page in run time ?
|
Javed/
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
|
|
Thats going to be a bit of programming, but basically you will have to find the IMG or img tags, extract the SRC or src attribute and figure out what that means in terms of a URL. Keeping in mind that an image source might be an absolute or a relative URL - also that there may be a BASE tag in the page that specifies a base different from the one the page lives at. Once you figure out the real URL you can open a URLConnection, get an InputStream, and read the binary image data. Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: Upload an HTML file along with images contained in that page
|
|
|