As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
package org.alfresco.web.scripts; import java.io.IOExecption; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class MyGenerateAndDownloadWebScript extends AbstractWebScript implements WebScript { protected static final Log logger = LogFactory.getLog(MyGenerateAndDownloadWebScript.class); public void execute(WebScriptRequest req, WebScriptResponse res) throws IOExceptio { WebScriptServletResponse wssr = (WebScriptServletResponse)res; wssr.getHttpServletResponse().addHeader("Content-Disposition", "attachment; filename=name.txt"); res.getWriter().append("Content…"); } }