jsp download file
dear \helper
can you help me to download a file (of any type) from server to client in a jsp code without it be opened in the browser {i.e. when user clicks the name which links to the file appear to him the save dialoge box to save the file where he choose}
is this pssible
thanks
Aly noor junior java developer
Just add these two line to your jsp.
response.setHeader("Content-Disposition", "attachment; filename= " + file + ".ext");
out.print(text);
where
1) file = filename u want to display on the dialog box and also the name with which the file will be saved.
2) ext = extension of the file u want to save the file.
3) text = actual contents of the file which u want to write in the file.