Allow user to download file from button component

Hi,

I’m trying to create a button instance that when clicked downloads a pdf to the user, however I can’t find any Vaadin 14 documentation for this.
Can anybody explain how to do this, or link documentation for it?

Many thanks,

Ahmet

Update for anyone with a similar problem: I’ve found out that this functionality was built into previous Vaadin versions, but for 14+ it’s easiest to use the File Download Wrapper add-on by Olli Tietäväinen: https://vaadin.com/directory/component/file-download-wrapper/discussions

You can wrap the download wrapper around a button to make the button essentially a download link, and then add the download wrapper to the page.

Hope I helped!

That’s a great add-on that can be used as the default component for Downloads. I urge vaadin to implement something similar or include this into the core. Nowadays, users expect to see a button for download, not an Anchor link.