|
|
|
@ -494,7 +494,7 @@ public class FTPUtils { |
|
|
|
* @param path |
|
|
|
* @param fileName |
|
|
|
*/ |
|
|
|
public static void downFile( HttpServletResponse response, String path, String fileName){ |
|
|
|
public static void downFile( HttpServletResponse response, String path, String fileName,String nameFile){ |
|
|
|
FTPClient ftpClient = getFTPClient(); |
|
|
|
//判断链接是否关闭 |
|
|
|
if(!ftpClient.isConnected()){ |
|
|
|
@ -529,7 +529,7 @@ public class FTPUtils { |
|
|
|
// 清空response |
|
|
|
response.reset(); |
|
|
|
// 设置response的Header |
|
|
|
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); |
|
|
|
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(nameFile, "UTF-8")); |
|
|
|
response.addHeader("Content-Length", "" + ftpFiles[i].getSize()); |
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|
|