How to save HTML file with images present in the server to local machine

Hi all

In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.

The code i am using is below :-

l

File fname = new File(filePath);

if(!fname.exists())return;

FileInputStream istr = null;

OutputStream ostr = null;

response.setContentType("application/"+format);

response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");

try {

istr = new FileInputStream(fname);

ostr = response.getOutputStream();

int curByte=-1;

while( (curByte=istr.read()) !=-1)

ostr.write(curByte);

ostr.flush();

}

Can anyone suggest what i need to do

regards

[799 byte] By [ervikasa] at [2007-10-2 9:48:03]
# 1
The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.
dmbdmba at 2007-7-16 23:53:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...