Or use the new DownloadAction - it is in the Struts 1.2.6 beta version, Details on the wiki
http://wiki.apache.org/struts/StrutsFileDownload http://svn.apache.org/dist/struts/v1.2.6/ Niall ----- Original Message ----- From: "Nick Heudecker" <[EMAIL PROTECTED]> Sent: Tuesday, April 26, 2005 6:46 PM Brian: This is pretty simple. Just get the output stream from the response object and stream the file down. Return null from the Action's execute method: private void returnFile(File f, OutputStream out) throws IOException { FileInputStream fis = null; try { fis = new FileInputStream(f); byte[] buf = new byte[8 * 1024]; int bytesRead; while ((bytesRead = fis.read(buf)) != -1) { out.write(buf, 0, bytesRead); } } catch (IOException ioe) { log.error(ioe, ioe); } finally { if (fis != null) fis.close(); } } On 4/26/05, Brian McGovern <[EMAIL PROTECTED]> wrote: > I'm wondering if anyone has any tips on how to render a pdf with struts. I want to mask the name of the pdf and just stream it to client. > > Thanks --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]