|
|
@@ -15,6 +15,8 @@ import com.uas.search.console.core.util.PathUtils;
|
|
|
@RequestMapping("/upload")
|
|
|
public class UploadController {
|
|
|
|
|
|
+ private static final String UPLOAD_DIR = PathUtils.getFilePath() + File.separator + "tmp" + File.separator;
|
|
|
+
|
|
|
private Logger logger = Logger.getLogger(UploadController.class);
|
|
|
|
|
|
@RequestMapping("")
|
|
|
@@ -30,7 +32,7 @@ public class UploadController {
|
|
|
|
|
|
logger.info("开始上传...");
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
- String targetFilePath = new StringBuilder(PathUtils.getFilePath()).append(fileName).toString();
|
|
|
+ String targetFilePath = UPLOAD_DIR + fileName;
|
|
|
File targetFile = new File(targetFilePath);
|
|
|
if (!targetFile.exists()) {
|
|
|
targetFile.mkdirs();
|