Re: return a dynamically created file with Tomcat5

From: Jay Graves (jay_at_skabber.com)
Date: 08/13/04


Date: 13 Aug 2004 10:51:13 -0700

Thanks people,
I got the desired result with the following.

response.setContentType("application/x-mft");
response.setHeader("Content-Disposition","attachment;FileName=file_xxx_yyy.mft");

jay@skabber.com (Jay Graves) wrote in message news:<54a3a7eb.0408121250.39e69146@posting.google.com>...
> Hello
>
> I am trying to return a file to the user when a certain .jsp or
> servlet is requested. For example if the user requests
> /webapp/start.jsp I would like to do some computations and based on
> certain server setting return the user a file of similar to
> user_xxx_yyy.mft (mft == My File Type).
>
> I can get the browser to understand that the response is of a
> different content type by either doing.
>
> response.setContentType("application/x-mft");
> or
> response.setHeader("Content-disposition","attachment;file=test.mft");
>
> But both of those always seem to present the user with a download
> dialog with the file name set as "start.jsp". Is there any way to
> return a response that sets the default file name to what I specify
> (uesr_xxx_yyy.mft)?
>
> Thanks



Relevant Pages

  • Re: HTML validation
    ... you probably don't want to instantiate this control on your server ... in response to user requests as it's pretty resource heavy. ... > Outgoing mail is certified Virus Free. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: getOutputStream() has already been called???
    ... this code doesn't really belong in a JSP. ... > I understand that it would be better suited for a servlet... ... > Thanks for the response. ... As for closing out: out.close ...
    (comp.lang.java.programmer)
  • RE: Unable to post a gzip compressed data and get the response
    ... > The jsp page supports gzip format and it is deployed in Tomcat server. ... > I tried to post a compressed data in gzip format and when i decompress the ... > But,I am able to post data using webrequest and am able to get the response ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How Do I Turn A JSP Screen Into A File?
    ... That will work but certainly doesn't seem to be an easy way and in addition I will have to keep the data file in sync with any changes made to the jsp. ... response with your own response wrapper. ... the PrintWriter of the original reponse and to ...
    (comp.lang.java.programmer)
  • return a dynamically created file with Tomcat5
    ... servlet is requested. ... For example if the user requests ... user_xxx_yyy.mft (mft == My File Type). ... return a response that sets the default file name to what I specify ...
    (comp.lang.java.programmer)