|
@@ -290,16 +290,17 @@ public class IndexCtl extends BaseWebCtl {
|
|
|
public WebJsonResult downloadUserOperationFile(String userId, HttpServletRequest request,HttpServletResponse response) {
|
|
|
// path是指欲下载的文件的路径。
|
|
|
String path = "";
|
|
|
- String fileNameTemp = "";
|
|
|
+ String fileName = "";
|
|
|
if(userId.equals("0")){
|
|
|
- path = GlobalData.SHENGJ_XZRY_CZSC;
|
|
|
+ path = GlobalData.UPLOAD_FILE_PATH + "\\userOperationFile\\江苏省港口建设与经营管理信息系统建设(软件部分)项目使用手册(省级行政管理人员)V2.1.doc";
|
|
|
+ fileName = "省厅行政人员系统操作手册.doc";
|
|
|
}else if(userId.equals("1")){
|
|
|
- path = GlobalData.SHIJ_XZRY_CZSC;
|
|
|
+ path = GlobalData.UPLOAD_FILE_PATH + "\\userOperationFile\\江苏省港口建设与经营管理信息系统建设(软件部分)项目使用手册(市级行政管理人员)V2.1.doc";
|
|
|
+ fileName = "市级行政人员系统操作手册.doc";
|
|
|
}else{
|
|
|
- path = GlobalData.SHIJ_JYR_CZSC;
|
|
|
+ path = GlobalData.UPLOAD_FILE_PATH + "\\userOperationFile\\江苏省港口建设与经营管理信息系统建设(软件部分)项目使用手册(经营人)V2.1.doc";
|
|
|
+ fileName = "市级经营人系统操作手册.doc";
|
|
|
}
|
|
|
- //从文件路径中获取文件名称
|
|
|
- fileNameTemp = path.substring(path.lastIndexOf("/")+1, path.length());
|
|
|
try {
|
|
|
// 以流的形式下载文件。
|
|
|
InputStream fis = new BufferedInputStream(new FileInputStream(path));
|
|
@@ -309,7 +310,7 @@ public class IndexCtl extends BaseWebCtl {
|
|
|
// 设置response的Header
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
response.setContentType("multipart/form-data");
|
|
|
- String fileName = URLEncoder.encode(fileNameTemp, "UTF-8");
|
|
|
+ fileName = URLEncoder.encode(fileName, "UTF-8");
|
|
|
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName);
|
|
|
response.getOutputStream().write(buffer);
|
|
|
} catch (IOException e) {
|