Have the servlet send the document, but set the header as follows:
response.setHeader("Content-disposition", "attachment; filename=" +
fileName);
This will change the name. If the content type is known and the user has
set his/her browser to "no prompt", the download will happen without
being propmted. If you really want to prompt the user for location use
a valid unknown content type like
response.setContentType("video/x-unknown");
If this content type is unknown, then the user will be prompted.
Kurt Kessel
[EMAIL PROTECTED]
> -----Original Message-----
> From: Desarrollo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 08, 2000 2:26 PM
> To: [EMAIL PROTECTED]
> Subject: file download
>
>
> hi...
> I'm developing a servlet that uses JavaMail API.
> When displaying the attachment
> information for a message, i want to display a URL such that when i
> click on that URL i get a "Save As" dialog from the web browser that
> is initialized with the filename of the attachment, so
> i need an URL that has the filename as the last component of
> the URL, followed by any needed "?" parameters, but
> in this case i need to create dinamically an servlet
> with the file name that i want, and then this invented
> servlet must call the really servlet ????
>
> how i do that???
> or, exist other solution ???
>
> thanks
>
>
>
>
> --------------------------------------------------------------
> ----------------------
> Obtenga su direcci�n de correo gratuita en
> http://serverlx.gye.ramt.com/servlets/mail
>
> ______________________________________________________________
> _____________
> 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