• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in writing a text file.

 
Harish Chandra Durgapal
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am writig a text file in my Web application but it stores at server.I want the created file is on local machine.Issue is ..
I am using jsp file for UI.Inputs from this jsp passes to a function written in java.This java file executes the required query and write the out put to a text file.
My problem is that the created text file stores at server I want to store it on local machine.How to do this..
Please help.
Thanks
Harish.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.

Browser makers go to great lengths to insure that there is no way for a webapp to write anything to a user's machine.

Have you considered writing it on the server and then making it available for download to the client?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you could stream this file to the client or like Ben suggested provide a URL to the user so that he/she can download it.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a public application I'd have to agree with the above. For a corporate app with a captive user population you might be able to get a little fancier, say with an Applet that writes to disk from Java code, requires a custom security file deployed ahead of time. Does that sound like an option?
 
Harish Chandra Durgapal
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,Stan
Thanks...
Can I have any means so that we can write it to local machine or it should ask user to save the file on local machine via java script.
thanks
Harish.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!