You can try by calling a servlet or jsp in that hyperlink or onclick of a button, and in that servlet/jsp set the content type [response.setContentType()] to the appropriate MIME type and the second thing you need to set is "content-disposition" header, see the bellow example
response.setHeader("Content-disposition","attachment; filename=fileName");
after setting these two values open the stream to the file and send all the bytes to the ourupt stream which you can get by response.getOutputStream()
- Rakesh
|