I've created a URL of the form
http://host.com/GetFile.jsp/test.doc?uid=100&msg=123 with
more parameters possibly at the end.  The program GetFile.jsp is run on my
web server fine, and I can then access the "test.doc" query parameter.  That
parameter tells me the name of the file to be returned.

The JSP gets the file and returns in the output stream.  I use this code as
well:

response.setContentType( att.getMimeType() );
response.setHeader("Content-Disposition","attachment;filename="+att.getOrigi
nalName());

Browser support is sporadic at best.  Some may download the Word doc inside
the browser window.  Some may request that you Open/Save As.  Sometimes the
Open causes the Word document to be opened just fine, but the web page
underneath it goes away.

I changed the "Content-Disposition: inline;filename=test.doc" and had other
behavior, but again not consistent.

First, does anybody know where to read about the HTTP header
Content-Disposition?  It doesn't appear to be part of the HTML 4.0 standard.

Second, is there a way to force all browsers to simply provide an Open/Save
As dialog for any kind of file, such that the name of the file to be saved
is the name I give it (like test.doc), and that it never opens another
browser window or causes the browser window to disappear when the "link" to
download it is clicked.

I don't see these problems so much on Yahoo mail when I do attachments, so
they seem to have figured this out.

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