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" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to