Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Saving a file on the client's machine
Joined: Mar 07, 2007
Mar 15, 2007 03:15:00
How to Save a file at the client place using
[BPSouther: Added meaningful subject line]
[ March 15, 2007: Message edited by: Ben Souther ]
Joined: Apr 14, 2004
Mar 15, 2007 03:25:00
Some advice: you'll get a better response if you
use a meaningful subject line
. Also, in order that those for whom English is not their first language have a better chance of understanding what is posted in these forums, we ask that you
refrain from using words that are not recognized English
, such as "plzzzzzzzzzz". Also, you might benefit from reading
Joined: Dec 11, 2004
Mar 15, 2007 07:57:00
In short, you can't.
Browsers, for security reasons, don't allow this.
What you can do, is set the Content-Type and Content-Disposition headers in such a way that the browser will prompt the user with a "Save As" dialog box.
See our JspAndExcel entry in the JSP FAQ page for an example that does this.
How to ask a question...
Simple Servlet Examples
It is sorta covered in the
JavaRanch Style Guide
subject: Saving a file on the client's machine
performance issues with file read and write
Struts FormFile (parsing .csv files)
Creating a file by giving relative path
WA #1.....word association
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013