How can a user download a file in client side (Google Web Toolkit)

前端 未结 4 1877
执笔经年
执笔经年 2020-11-30 12:58

I\'m using GWT(Google Web Toolkit) to make a website. I need to show a table to the user, and let the user download the contents of the table.

On the client side, h

4条回答
  •  离开以前
    2020-11-30 13:17

    If you know the path of the file, Code snippet is shown below.

    button.addClickHandler(new ClickHandler()  
    { 
    
        @Overrid
        public void onClick(ClickEvent event) 
        {
            Window.open(GWT.getHostPageBaseURL() + "/file.rar", "name", "enabled");
        }
    });
    

提交回复
热议问题