File Download

Use the code below to force browsers to pop open a file save dialog when they access your page.

In JSP


response.setHeader("Content-Disposition", "attachment;filename=myfile.txt");
response.setContentType("application/download");

In PHP


header("Content-Disposition: attachment;filename=myfile.txt");
header("Content-Type: application/download");