If memory serves (its been awhile since I've seen this one come up) make
sure that the desired filename is the very last thing in the url. The
browser will assume this is the filename to use for saving the file.
example: brainopolis.com/download.do/dynamicFile.txt
The save-as window should show "dynamicFile.txt" as the default name.
Lance
----- Original Message -----
From: "Duffey, Kevin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 29, 2000 9:37 PM
Subject: Send a file back for saving and give it a name??
Hi there,
We have on our site the ability for users to select a document id and it
will return a file for them to save (and later reuse). The document is
created dynamically in memory on the server, and we set the contentType to
application which DOES pop up the "Save As" dialog box on the clients
machine. They can save the text file. The problem is, the filename that is
in the dialog is the path used to call the servlet. In our case, we are
using an MVC framework with .do mapped to a controller servlet. We have a
/download.do and every time..no matter what file we send back, the dialog
that pops up saves it as dialog.do. Is there any way at all to change the
name of the file that appears in the dialog box?
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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