Upload an HTML file along with images contained in that page
Muhammed Akhtar Hossain
Joined: Jun 11, 2003
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 ?
Author and all-around good cowpoke
Joined: Mar 22, 2000
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