RE: Writing a text file back to browser from a servlet

2006-10-18 Thread Tim Lucia
g File->Save As gives unpredictable results. Tim -Original Message- From: David Kerber [mailto:[EMAIL PROTECTED] Sent: Monday, October 16, 2006 8:23 PM To: Tomcat Users List Subject: Re: Writing a text file back to browser from a servlet This worked, though not exactly how I expecte

Re: Writing a text file back to browser from a servlet

2006-10-16 Thread David Kerber
This worked, though not exactly how I expected. The "save file as..." box comes up and works, but is there a way of showing the file in the browser screen as well? Right now, it keeps the previous page displayed while prompting to save the download. I can live with that if I have to, but it

Re: Writing a text file back to browser from a servlet

2006-10-14 Thread David Kerber
Thanks, Tim - I'll give that a try later today. Dave Tim Lucia wrote: You could stream it directly to the user, if practical (why write to a temp file only to stream that back to the user?) In order to be recognized by the browser as text and an attachment, you should: response.setContentTy

RE: Writing a text file back to browser from a servlet

2006-10-14 Thread Tim Lucia
You could stream it directly to the user, if practical (why write to a temp file only to stream that back to the user?) In order to be recognized by the browser as text and an attachment, you should: response.setContentType("text/plain; charset=UTF-8"); response.setHeader("Content-disposition", "