Hi, i’m testing vaadin 7.3 beta
I have some trouble to have FileDownloadre running, when i execute the code that i posted, nothing happen.
Any advice ?
Thanks
public void startDownload(String externalUrl) {
try {
DownloadResourceExternal downloadResourceExt = new DownloadResourceExternal(new URL(externalUrl));
DownloadResource downloadResource = new DownloadResource(downloadResourceExt.getInputStream(), downloadResourceExt.getFilename());
downloadResource.getStream().setParameter("Content-Length", String.valueOf(downloadResourceExt.getSize()));
downloadResource.getStream().setCacheTime(0);
Button b = new Button("download");
FileDownloader fd = new FileDownloader(downloadResource);
fd.extend(b);
b.click();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}