Force the browser to download the content
Unfortunately, it’s not possible to tell window.open to force-download the target content:
window.location.href = [url]instead of
window.openmight seem to be working (it works for PDF and CSV files), but HTML and JSON files are still displayed inline in the browser, rather than being downloaded.
- The same by setting target to
The only way is to set the Content-Disposition HTTP header header
This feature has been added to Vaadin 22, see flow #5471 for more details.