There is a download servlet which specifies the file name which is available
as part of the Expresso Framework (open source). This servlet is used on
the javacorporate site for downloading any of the javacorporate components -
so you'll be checking it out when you download the Framework :)
Sandra
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Larry
> Tate
> Sent: Tuesday, December 14, 1999 10:59 AM
> To: [EMAIL PROTECTED]
> Subject: how to download file with filename specified
>
>
> servet experts,
>
> I'm trying to download a file from my server using servlets.
> However, when it prompts for the local filename (netscape browser)
> it gives the default name of the file as the name of the servlet. This
> is undesireable. I would like to specify the name.
>
> I see the sun downloads do this all the time.
>
> I currently do this:
>
> res.setContentType("application/x-zip-compressed");
> res.setContentLength(<filesize>);
> OutputStream out= res.getOutputStream()
>
> <Then use the OutputStream to write the file>
>
> It works, the file is downloaded correctly. However, the
> prompt in netscape is not good.
>
> Is there a header to try?
>
> Thanks,
>
> larry
> --
> Larry Tate [EMAIL PROTECTED] (757)726-6662
> Bldg 135, Ft. Monroe, VA, 23651
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html