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

