When downloading a file how do you get the users (client) computer to
use the
print command/option instead of the open command/option.
(Maybe the the same way you get a desktop shortcut to print instead of
open when its double clicked on.)
relevant code...
private void downloadFile(String attachmentId, HttpServletResponse
response) {
Attachment attachment=Attachment.retrieve(attachmentId);
try{
BufferedOutputStream bos=new
BufferedOutputStream(response.getOutputStream());
response.setContentType(attachment.getMime_type_txt());
response.addHeader("Content-Disposition", "attachment;
filename="+attachment.getFile_nm()); //maybe something here
bos.flush();
bos.write(attachment.getFile_contents_bin());
bos.close();
}
catch(Exception e) { e.printStackTrace(); }
}
Eric D. Lemle
Senior Programmer / Analyst
Intermountain Health Care
36 South State Street, Suite 1100
Salt Lake City, Utah 84111
United States of America (USA)
(801) 442-3688 -- e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]