Here's an example:
public class Downloader extends HttpServlet
{
private void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Cache-control", "no-cache");
resp.setIntHeader("Expires", -1);
MyData data = new MyData();
resp.setHeader("content-type", "application/pdf");
resp.setHeader("content-encoding", "binary");
resp.setHeader("Content-Disposition", "attachment;
filename=myfile.pdf");
data.writePDFDataToOutputStream(resp.getOutputStream());
}
}
elyes sallem wrote:
ok, do you have an example?
Thanks
Regards
Elyes
2008/12/15 Dave Newton <newton.d...@yahoo.com>
--- On Mon, 12/15/08, elyes sallem wrote:
the problem is that with the html:file you must browse to an
existant file, but in my case, i wanna browse to a new file,
and then in the action i will make some treatment, generate
data and export them to this file
That's not how you do that.
You stream the response back and the user gets a save-file dialog.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org