Best way to offer a Download-Link via Buttton

In vaadin 8 i was using com.vaadin.server.FileDownloader to offer a filedownload.

			File file = new File(str);
			downloadButton = new Button(file.getName())
			Resource res = new FileResource(file);
			FileDownloader fd = new FileDownloader(res);
			fd.extend(downloadButton);

How can i make it in vaadin 12?

Hi Hans,

There are several threads in this forum about downloading. Here’s two of them:

https://vaadin.com/forum/thread/17061112/download-link-or-button

and

https://vaadin.com/forum/thread/17434646/vaadin-10-let-user-download-a-file-with-dynamically-defined-filename