How to prompt user to specify a file location in Vaadin 7

Hello guys,

I have feature that exports and generates csv using opencsv in vaadin 7. The problem I have is how to get a file location to save a file on users local machine.

Below is a line that needs a path to where to save a generated file.

CSVWriter writer = new CSVWriter(new FileWriter("H:\\dummy\\export"+timestamp+".csv")); Instead of having a static file path, I need to prompt the user for where to save a file, as well as how the user wants to name a file.

I appreciate your help.

There is only one way for the browser to access the local file system, and that is using a signet applet. No Vaadin (or other JavaScript) code can access the file system, since browsers do not allow it.

To store a file on the local file system, you need to have the user download the file, with e.g. the FileDownloader extension.