【问题标题】:How to Download a File from the Server Side to the HD如何从服务器端下载文件到硬盘
【发布时间】:2013-02-26 12:56:33
【问题描述】:

我生成了一个 pdf 文件,现在它在服务器上,现在有什么方法可以将它下载到我的桌​​面吗?

我在客户端使用smartGWT,在我的服务器端使用java。

【问题讨论】:

标签: java http download smartgwt


【解决方案1】:

写一个Servlet.这里是example

然后使用以下代码:

Window.open(GWT.getHostPageBaseURL()
        + "/PdfDownload?path=filepath, "", "");

通过req.getParametr("filepath");分配文件路径

【讨论】:

    猜你喜欢
    • 2011-03-17
    • 2019-12-11
    • 2023-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-13
    • 2015-06-27
    相关资源
    最近更新 更多