2013-02-26 87 views
1

我生成了一個pdf文件,現在它在服務器上現在有什麼方法可以將它下載到我的桌​​面上嗎?如何將文件從服務器端下載到HD

我在客戶端使用smartGWT,在服務器端使用java。

+0

http://stackoverflow.com/questions/4020949/how-to-download-a-file-using-分配的文件路徑gwt-client – Adi 2013-02-26 12:59:37

+1

這個問題,正如評論所述,已經回答[這裏](http://stackoverflow.com/questions/4020949/how-to-download-a-file-using-gwt-client) – christopher 2013-02-26 13:01:14

回答

0

寫一個Servlet.這是example

然後通過使用下面的代碼:

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

通過req.getParametr("filepath");