I have a file that I'd like to return from my web server, but the name of
the file on the web server is not the same name I'd like it to "download" as
(like the default name that appears in the Save As when the file download
dialog displays).

For example, the real file name may be something like
/usr/local/apache/uploaded/u100 which was originally called something like
foo.doc when it was uploaded.  The file was renamed in order to allow
multiple foo.doc files to be uploaded by many people without there being any
conflict in file names (or even multiple uploads from the same person, but
each one is unique).

I have a Java servlet that can set the content-type and then writes the u100
file to the output stream,  but the file is called "u100" by default.  I'd
like the user to see by default the original name (foo.doc).  I have this
info in my database, but I'm not sure how to set the "file name" of the
downloaded file.  Is there something in the HTTP headers or the like that I
can set like the content-type attribute is used to say whether it's
text/html, text/plain, application/msword, etc.?

Thanks,
David

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to