Download FileResource


if I want to download a file, always get the message that the browser has prevented a pop-up window opens.

How can I handle this?

Here is my Code:

Button btn = new Button(“Download”, new ClickListener()
public void buttonClick(ClickEvent event)

protected void download()
File downloadFile = new File(path);
FileResource resource = new FileResource(downloadFile, getMainWindow()

	getMainWindow().open(resource, "_blank");


Yeah, that’s a common problem that is mostly out of the control of the developer (There would be no point in the blocker if we could go round it, would there?). Most of the time I ‘solve’ it by opening the stream in the same window (so remove the string parameter). This is usually more acceptable for most browsers.