Re: return a dynamically created file with Tomcat5
From: Jay Graves (jay_at_skabber.com)
Date: 08/13/04
- Next message: Jared MacDonald: "Re: Unusual application for code coverage tool?"
- Previous message: Aakhil: "Cannot bind to wsdl"
- In reply to: Jay Graves: "return a dynamically created file with Tomcat5"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Jared MacDonald: "Re: Unusual application for code coverage tool?"
- Previous message: Aakhil: "Cannot bind to wsdl"
- In reply to: Jay Graves: "return a dynamically created file with Tomcat5"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|