Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Download data on to local machine

 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)I have created a jsp(index.jsp) and a Servlet that gives the output after processing the error.log files using FileOutputStream based on the given input(say, name) to the index.jsp
2)I have a button "SaveClipboardData" created on jsp that allows to copy the data onclick of that.

The problem is when I deploy that application in the remote server obviously the data get copied on to the remote machine,because
I gave the file path as below in the servlet .


Instead what I was looking at is if any client click the "SaveClipboardData" button on "index.jsp" there should be a prompt
which allows him to browse to his local directory and copy the data into his(Client) localmachine rather then on the remote.(Similar to the webpages that
we download)

Please suggest me how to proceed
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to send the data back to the browser - not save the data to a file. Investigate Response.getWriter() and Response.SetContentType(). Note that you cannot force a browser to prompt a user to select a file to save to disk. That all depends on how the user sets up the browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic