tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dodd Gatsos <dgat...@slb.com>
Subject Re: How to specify a name for a content beeing served by s servlet
Date Thu, 09 Jan 2003 21:36:23 GMT
Yes,

This is exactly what I did to send .csv files to the client with the correct
name of the file rather than the called servlet as the default filename.
Worked like a charm on both IE and Netscape.

Dodd

----- Original Message -----
From: <jon@mkodo.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Thursday, January 09, 2003 11:19 AM
Subject: Re: How to specify a name for a content beeing served by s servlet



I found this resource:
http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html

I've seen people say they use the Content-disposition header to get around
this issue but I haven't needed to do this yet...

Example:
Content-disposition: attachment; filename="file2.gif"

HTH,

Jon

Quoting Cédric Viaud <cedric.viaud@matrasi-tls.fr>:

> Hi,
>
> i would like to know if it is possible to indicate in the HTTP header of a
> response a name for a ressource.
>
> Let be a little clearer.
>
> I got a controler servlet wich map all request with "*.do". I check the
URL
> use the name before the ".do" to know the command.
> For exemple, if the request is "getRequest.do", my servlet look for what
to
> do with "getRequest".
>
> My problem is that i use this servlet to serve native contents (such as
> images, video, etc ...). On request like
"getNativeContent.do?id=42135125",
> my servlet look for the native content of id=42135125, and send it back to
> the client. I set the correct "content-type" and use a ServletOutputStream
to
> send binary content.
>
> It works fine, but i've got a light problem. It seem's that the content
type
> is not always used by the client to know wich application must be run, but
> the file name is used (the extension of this filename). Or, the filename
that
> the client see is "getNativeContent.do" and so the extension is "do". In
this
> case, the user is prompted for which application must be associated with
the
> ".do" extension. More that this, if the user want to save it to disk, the
> defaut name is "getNativeContent.do".
>
> Is there a way to indicate a name for the ressource beeing served to the
> client ? I've spent much time on the HTTP RFC, be i can't manage to find
what
> i'm looking for.
>
> Sorry for my awfull English.
>
> Regards,
>
>     Cédric
>
>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message