tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Helmling ...@panix.com>
Subject Re: populating save as... dialog for application/octet-stream content type (solved maybe)
Date Mon, 04 Feb 2002 20:31:28 GMT
On Sun, 2002-02-03 at 07:53, rob wrote:
> I tried the following
> 
> request.setHeader("Content-Disposition", "attachment; filename="mypdf.pdf");
> 
> and it seemed to work, is this the correct way or is there a more
> appropriate way to do this?
> 
> Thanks
> 


That is the correct way.  I've had to use a "fake" mime-type to get this
to work with all versions of IE, though (like
"application/x-vnd-yourcompany").  See RFC 2616 for more info:


19.5.1 Content-Disposition
The Content-Disposition response-header field has been proposed as a
means for the origin server to suggest a default filename if the user
requests that the content is saved to a file. This usage is derived from
the definition of Content-Disposition in RFC 1806 [35].

  content-disposition = "Content-Disposition" ":"
                         disposition-type *( ";" disposition-parm )
  disposition-type = "attachment" | disp-extension-token
  disposition-parm = filename-parm | disp-extension-parm
  filename-parm = "filename" "=" quoted-string
  disp-extension-token = token
  disp-extension-parm = token "=" ( token | quoted-string )

An example is
  Content-Disposition: attachment; filename="fname.ext"


--g


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message