简体   繁体   English

如何从服务器端将文件下载到HD

[英]How to Download a File from the Server Side to the HD

I generated a pdf file and now its on the server now is there any way to download it to my desktop for example? 我生成了一个pdf文件,现在可以在服务器上将其下载到台式机了吗?

I am using smartGWT at the client side and java on my server side . 我在客户端使用smartGWT ,在服务器端使用java。

Write one Servlet. 编写一个Servlet. Here is the example . 这是例子

Then by using the below code : 然后使用以下代码:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM