Re: Code for downloading files from server
Posted By:
jonathan_wasson
Posted On:
Wednesday, May 2, 2001 12:23 PM
Create the file on the server... i.e. for a .jsp...
<%! public boolean writeToFile(String fileName, String fileContent){
boolean success;
try {
File outputFile= new File(fileName);
FileWriter fw=
new FileWriter (outputFile);
BufferedWriter bw =
new BufferedWriter(fw);
bw.write(fileContent);
bw.close();
fw.close();
success = true;
}
catch (Exception e) {
success = false;
};
return success;
}
%>
and then provide an href link to it on a preceding web page.