Two Laptop Bag*
The moose likes JSP and the fly likes Saving a file on the client's machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Saving a file on the client Watch "Saving a file on the client New topic
Author

Saving a file on the client's machine

prabhakar pullela
Greenhorn

Joined: Mar 07, 2007
Posts: 7
How to Save a file at the client place using JSP.

[BPSouther: Added meaningful subject line]
[ March 15, 2007: Message edited by: Ben Souther ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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 this.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Don't get me started about those stupid light bulbs.
 
subject: Saving a file on the client's machine
 
Similar Threads
WA #1.....word association
java io
Creating a file by giving relative path
performance issues with file read and write
Struts FormFile (parsing .csv files)