----- Original Message -----
From: Alvaro Fuentes <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 10, 1999 2:13 PM
Subject: Problem downloadind files.


> We are developing a servlet that serves files from the server writing on
> ServletOutputStream. The problem is that when the browser asks for the
file's
> name, the default is the servlet's name, not the file's name. How can we
tell the
> browser the file's name? Any header field? We are using
> "application/octect-stream" as content-type.
>
> Thanks
>
>
___________________________________________________________________________
> 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

You can make the servlet appear to be a file of a different name and
associating it to a particular
file extension by setting your web server to pass requests for a particular
file type ie .doc
to your servlet engine and then setting your servlet engine to pass requests
for that file type
to your servlet by mapping that file type to be serviced by your servlet.
Mime types requests can also
be handled by particular servlets as well.

The URL you then use can be say <a
href="http://yourserver/path/filename.ext">File to download"</a>

and your servlet will pick up the the request, you can find out from the
request headers which file should actually be
served to the client and the browser thinks it is picking up a file of that
name.

At least that is what is supposed to happen

Andy Bailey

___________________________________________________________________________
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