Hy guys, I am using vaadin 8 and I have a problem, to download a file from my web app.
To create the button to download, I have :
Button downloadCompanyDocument = new Button();
downloadCompanyDocument.setIcon(VaadinIcons.DOWNLOAD);
downloadResource = createFileResource(rd.getFileReference());
downloadResource.setFilename(rd.getFileReference().getFileId());
FileDownloader fileDownloader = new FileDownloader(downloadResource);
fileDownloader.extend(downloadCompanyDocument);
and “createFileResource” function is:
private StreamResource createFileResource(FileReference fileReference) {
StreamResource sr = new StreamResource(new StreamSource() {
@Override
public InputStream getStream() {
try {
return fileReferenceService.getInputStream(fileReference);
} catch (IOException e) {
LOG.error(e.getMessage());
}
return null;
}
}, null);
sr.setCacheTime(0);
return sr;
}
When I click on the button, on Chrome, FF works fine, but doesn’t work in IE.
Please, give me a solution!
Thanks