This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes return a text file from webapp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "return a text file from webapp" Watch "return a text file from webapp" New topic

return a text file from webapp

Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi again
I can't find solution to my problem. I need to save in the user local disk a txt file with some text inside, when the user press a button on a webapplication page.
Anybody can say me how to do this or where to find code examples.

Joe Ess

Joined: Oct 29, 2001
Posts: 9138

What is the problem with what we talked about in your previous post?

[How To Ask Questions On JavaRanch]
Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
I can't find the way to create and return the txt file (to save to disk) to the user that press a button on the web application.
I need to do two things when user press ok, show a result on screen and give the oprtunity to save that results on a txt file into the disk

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
To write to the disk, just use FileWriter or BufferedWriter.
To read from disk, just use FileReader or BufferedReader.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: return a text file from webapp
It's not a secret anymore!