Directory

← Back

SimpleFileDownloader

SimpleFileDownloader

Author

Rating

Popularity

100+

Modified version of Vaadin FileDownloader component. It allows to launch downloading resource by any event.

1.0.4 version - Vaadin 7 2.0.0 version - Vaadin 8 (Big thanks to ScreamingTree86 https://github.com/ScreamingTree86 for preparing port to Vaadin 8 version!)

Sample code

final VerticalLayout layout = new VerticalLayout();
		layout.setMargin(true);
		setContent(layout);

		SimpleFileDownloader downloader = new SimpleFileDownloader();
		addExtension(downloader);
		
		Button button = new Button("Click Me");
		button.addClickListener(new Button.ClickListener() {
			public void buttonClick(ClickEvent event) {
				final StreamResource resource = new StreamResource(() -> {
					return new ByteArrayInputStream("This is test clicked on button".getBytes());
				}, "testButton.txt");
				
				downloader.setFileDownloadResource(resource);
				downloader.download();
			}
		});
		layout.addComponent(button);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2018-12-22
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.0+
Vaadin 7.0+ in 1.0.4
Browser
Browser Independent

SimpleFileDownloader - Vaadin Add-on Directory

SimpleFileDownloader SimpleFileDownloader - Vaadin Add-on Directory
Modified version of Vaadin FileDownloader component. It allows to launch downloading resource by any event. 1.0.4 version - Vaadin 7 2.0.0 version - Vaadin 8 (Big thanks to ScreamingTree86 https://github.com/ScreamingTree86 for preparing port to Vaadin 8 version!)
Online