This commit is contained in:
2022-03-10 11:53:03 +08:00
parent b74dd02f87
commit d6cda043fb
9 changed files with 264 additions and 51 deletions

View File

@ -39,15 +39,16 @@ public class ExcelUploadUtil {
String suffix = originalFilename.substring(index);
//uuid生成新的文件名
String newName = UUID.randomUUID().toString() + suffix;
File file = new File("/Users/liuchengqian/Desktop/DaJiang/" + subDir);
// File file = new File("/home/sxy/server/industrial_measurement/" + subDir);
// File file = new File("/Users/liuchengqian/Desktop/DaJiang/" + subDir);
File file = new File("/home/sxy/server/industrial_measurement/" + subDir);
if (!file.exists()) {
file.mkdirs();
}
String path = "/Users/liuchengqian/Desktop/DaJiang/" + subDir + newName;
// String path = "/home/sxy/server/industrial_measurement/" + subDir + newName;
// String path = "/Users/liuchengqian/Desktop/DaJiang/" + subDir + newName;
String path = "/home/sxy/server/industrial_measurement/" + subDir + newName;
//实现上传
fileInput.transferTo(new File(path));
// return path;
return "http://118.24.27.47:2088/" + subDir + newName;
}
return null;