DownloadStream in Vaadin 14

Hi everyone,

I want to display the tipical popup that allows the user to choose the directory and choose the name to store a new file locally.
I’ve read that the DownloadStream used to be the solution, but I cannot find it in Vaadin 14.

Does this have another name? Or any other API for this?

Thanks in advance.

Maybe this example is helpful: https://cookbook.vaadin.com/csv-download

Hi Olli,
thanks for your help and for the example, but is just a download. There is not utility in Vaadin 14 like the DownloadStream?
I need to give to the user the possibility to choose the name and directory of the new file.

Thanks!

In older Vaadin versions, DownloadStream is just a way of providing a data stream (like StreamResource is in the example I linked); it doesn’t have anything to do with the user choosing the file name or the directory. Where and how the file is saved on the end user’s computer depends on browser settings, which aren’t controlled by the web application. Nowadays most browsers tend to download files directly to a specific directory. For example, in Chrome you can go to Settings → Advanced → Download and toggle “Ask where to save each file before downloading” if you want to choose where files end up being saved.

Ohh I understand now, sorry for the confusion.
Thanks for your help!