Hi,
I’m using Vaadin 8.
I want to preview image and provide a way to save it to disk with a button.
I have a Window with content of Image and a Button
String resourceURL = // any link of PNG image from google
Button downloadBtn = new Button("download");
ExternalResource source = new ExternalResource(resourceURL);
FileDownloader downloader = new FileDownloader(source);
downloader.extend(downloadBtn);
After clicking on button downloading does not start, instead of this I have ultrafast browser loading action. I mean Chrome shows spinner like while loading page, it’s lasts less than a second.
If I use StreamResource as source (ie. from
https://vaadin.com/docs/-/part/framework/application/application-resources.html#application.resources.stream
) downloading works.
Can i create a StreamResource from URL? Later I want to download files with other type than Image, also using URL.