tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rob" <rob_m...@fastmail.fm>
Subject Re: populating save as... dialog for application/octet-stream content type (solved maybe)
Date Sun, 03 Feb 2002 12:53:32 GMT
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

----- Original Message -----
From: "rob" <rob_mail@fastmail.fm>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Sunday, February 03, 2002 11:01 PM
Subject: populating save as... dialog for application/octet-stream content
type


> I'm trying to 'suggest' a filename for download when I send binary output
as
> a reply.
>
> I would like the suggested filename to appear in the save as... dialog
that
> pops up when the response is sent (rather than whatever the url may be at
> the time).
>
> My servlet basically does this.
>
> setContentType("application/octet-stream");
> open a file ..
> OutputStream is = response.getOutputStream();
> loop ( read from file into buffer while not end of file )
> is.write( buffer );
> close streams input & output
>
> If there is a more appropriate list for this posting please tell me.
> Otherwise a solution would be helpful.
>
> Thanks
>
> rob
>
>
>
> --
> 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>
>


--
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