>I've set up a simple file serving servlet using a ServletOutputStream &
>URLConnection.
>
>The files download fine, but I lose the original file name, instead I get
>the servlets mapped name and an object reference (eg MyServlet67f6b)
>Do I have to set a header ?
>
>Thankyou.
>--
>Mike W
>
>
>Set the HTTP Header  "Content-Disposition"
>
>response.setHeader("Content-Disposition",
>"attachment;filename=yourFileName");
>
>-Saravanan
>

Thankyou, that has done the trick.

Although the file is saved with the intended file name the download
intercepting window still comes up with the servlets name ie

'You are downloading the file MyServlet from Localhost'

Anyone know the way round that one?

I suppose you could sendRedirect to a servlet mapped as /download/* and then
call it via download/myFilename but that's a terrible solution!!

Mike W.

___________________________________________________________________________
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

Reply via email to