Use the code below to force browsers to pop open a file save dialog when they access your page.
In JSP/Servlet
response.setHeader("Content-Disposition", "attachment;filename=myfile.txt");
response.setContentType("application/download");
Blog on things around me - Applications, Java Platform, Free & Open Source Software, Gadgets, Utilities...
Talking to #AI may be the most important job skill of this century ( JohnGoodPasture ) Role of account management over the years. It’s a ro...
3 comments:
good one ... thanx
This is NOT correct. You must use application/octet-stream for unspecified binary data. Some browsers may try to display your data as text if you use application/download
IN PHP
header("Content-Disposition: attachment; filename=myfile.txt");
header("Content-Type: application/download");
Post a Comment