Hey guys.
I have a question which I seem not to be able to find a solution for. I have a table with 2000+ elements which are packages you can download. You can press any of the element and then press a universal download button to download. Well, that is my wish for what it would do.
Essentially the download link is a dynamically created link which i get from a metadatabase. I have everything prepared. I have the button which calls the function void downloadPackage()
. This get the information for the link.
My problem is that the link is not a link with a file extension. The link look something like this: https://mylink/package/version
. The mylink is a randomstring. This changes every few minute because… reason. So notice how the link doesn’t end with a .zip. This is my problem.
So the only way to download the file for my knowledge, is to open this link manually which will create a new tab to the link, which will then begin downloading the package, which name is also random characters.
My question is: Does there exists some functionality with Vaadin which open this link to download the file without it changing website or open a new tab?
Also to be helpful. I already have the button setup to use
UI.getCurrent().getPage().open("https://mylink/package/version");
This opens a new tab which download the file and then the user have to manually close the tab. Can this be done without having to open a new tab.