Specifying the filepath of the file to be saved with Filedownload.Save()

asked 2013-12-16 16:21:01 +0800

Antoc gravatar image Antoc
21 4

I want to save via the Filedownload.save() method the content of a StringBuffer object in a CSV file named output.csv. I would like to save the file in a specific path (i.e.'home/Documents/'), but it seems that it's not possible to specify the location of the file, only its name. Does anyone have a clue about how to overcome this? This is my kittle piece of code:

Filedownload.save(stringBuffer.toString(), "application/vnd.ms-excel", "output" + ".csv");

delete flag offensive retag edit


When I see your profile You never vote, set correct answer of further comment to get to solution. Please consider to do this for good follow up of the question.

chillworld ( 2013-12-18 08:03:36 +0800 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-12-16 22:42:38 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9

updated 2013-12-16 22:43:42 +0800

Filedownload is normally used at client side for downloading a file. If you have already the file at your server and you will save it at server side you need just "normal" java to write your file. see example here to write a file :


and doc of Filedownload here :


link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2013-12-16 16:21:01 +0800

Seen: 17 times

Last updated: Dec 16 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More