file_download_attribute.sjs (424B)
1 function handleRequest(request, response) { 2 // Only answer to http, in case request is in https let the reply time out. 3 if (request.scheme === "https") { 4 response.processAsync(); 5 return; 6 } 7 8 response.setHeader("Cache-Control", "no-cache", false); 9 response.setHeader("Content-Disposition", "attachment; filename=some.html"); 10 response.setHeader("Content-Type", "text/html"); 11 response.write("success!"); 12 }