Re: How to specify a name for a content beeing served by s servlet

2003-01-14 Thread Cédric Viaud
Ok,

it now work fine. I just make a little modification to the code with :
response.setHeader(Content-Disposition,inline; filename=+archive);

If i put attachment and not inline i can't manage to have the native
contents embemded in my page for data such as images.

Thanks everybody for the help.

Cédric


- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 7:23 PM
Subject: Re: How to specify a name for a content beeing served by s servlet




 On Thu, 9 Jan 2003, Cédric Viaud wrote:

  Date: Thu, 9 Jan 2003 17:24:24 +0100
  From: Cédric Viaud [EMAIL PROTECTED]
  Reply-To: Tomcat Users List [EMAIL PROTECTED]
  To: Tomcat users [EMAIL PROTECTED]
  Subject: How to specify a name for a content beeing served by s servlet
 
  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.
 

 Various versions of Internet Explorer are particularly awful about
 ignoring the Content-Type header.  However, you might want to look at the
 Content-Disposition header in addition, so you can suggest a filename (and
 let IE do it's assumptions based on the filename extension):

   Content-Type: image/gif
   Content-Disposition: attachment; filename=foo.gif

 There are some security issues surrounding the use of Content-Disposition
 -- for more info, see the HTTP/1.1 specification:

   http://www.rfc-editor.org/rfc/rfc2616.txt


  Regards,
 
  Cédric
 
 
 Craig



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Cédric Viaud
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




RE: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Ralph Einfeldt
You are looking at the wrong spec :}

It part of the mime standard:

http://www.nacs.uci.edu/indiv/ehood/MIME/rfc2183.txt

You need to set a header Content-Disposition
with the value of filename=somefile.ext;

 -Original Message-
 From: Cédric Viaud [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 09, 2003 5:24 PM
 To: Tomcat users
 Subject: How to specify a name for a content beeing served by 
 s servlet
 
 i would like to know if it is possible to indicate in the 
 HTTP header of a response a name for a ressource.
snip/ 
 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.
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Jason Pyeron
Cédric,

You could write something like this, as we have done.

 /some-path/getbyidservice/93847572934/foo-filename.jpg

We have done this in Perl, and will be attacking this in servlets 1st week 
February.

This allows the browser to cache (if allowed by headers) and to have the 
extension/filename set as intended.

If you want to encode more details in the request, i don't see why you 
cannot introduce delimiters into the id path element.

-jason pyeron

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron   http://www.pyerotechnics.com   -
- Owner  Lead  Pyerotechnics Development, Inc. -
- +1 410 808 6646 (c)   500 West University Parkway #1S -
- +1 410 467 2266 (f)   Baltimore, Maryland  21210-3253 -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.


On Thu, 9 Jan 2003, Cédric Viaud wrote:

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:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: How to specify a name for a content beeing served by s servlet[off-toppic]

2003-01-09 Thread Jason Pyeron
yea, i agree but not all [dumb?] browsers respect it.

-jason pyeron

On Thu, 9 Jan 2003, Ralph Einfeldt wrote:

You are looking at the wrong spec :}

It part of the mime standard:

http://www.nacs.uci.edu/indiv/ehood/MIME/rfc2183.txt

You need to set a header Content-Disposition
with the value of filename=somefile.ext;

 -Original Message-
 From: Cédric Viaud [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 09, 2003 5:24 PM
 To: Tomcat users
 Subject: How to specify a name for a content beeing served by 
 s servlet
 
 i would like to know if it is possible to indicate in the 
 HTTP header of a response a name for a ressource.
snip/ 
 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.
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron   http://www.pyerotechnics.com   -
- Owner  Lead  Pyerotechnics Development, Inc. -
- +1 410 808 6646 (c)   500 West University Parkway #1S -
- +1 410 467 2266 (f)   Baltimore, Maryland  21210-3253 -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Craig R. McClanahan


On Thu, 9 Jan 2003, Cédric Viaud wrote:

 Date: Thu, 9 Jan 2003 17:24:24 +0100
 From: Cédric Viaud [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat users [EMAIL PROTECTED]
 Subject: How to specify a name for a content beeing served by s servlet

 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.


Various versions of Internet Explorer are particularly awful about
ignoring the Content-Type header.  However, you might want to look at the
Content-Disposition header in addition, so you can suggest a filename (and
let IE do it's assumptions based on the filename extension):

  Content-Type: image/gif
  Content-Disposition: attachment; filename=foo.gif

There are some security issues surrounding the use of Content-Disposition
-- for more info, see the HTTP/1.1 specification:

  http://www.rfc-editor.org/rfc/rfc2616.txt


 Regards,

 Cédric


Craig



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread jon

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 [EMAIL PROTECTED]:

 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:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Dodd Gatsos
Sorry,  Here's the code line I used:

response.setHeader(Content-Disposition,attachment; filename=+archive);

Dodd

- Original Message -
From: [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
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 [EMAIL PROTECTED]:

 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:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to specify a name for a content beeing served by s servlet

2003-01-09 Thread Dodd Gatsos
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: [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
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 [EMAIL PROTECTED]:

 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:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]