|
|
@@ -139,7 +139,7 @@ public class FileUploadController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/docs")
|
|
|
- public ResponseEntity<String> uploadDoc(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
|
|
|
+ public ResponseEntity<String> uploadDoc(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws IOException {
|
|
|
|
|
|
if (file.isEmpty()) {
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("文件不能为空");
|
|
|
@@ -173,7 +173,7 @@ public class FileUploadController extends BaseController {
|
|
|
}else {
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("上传文件错误");
|
|
|
}*/
|
|
|
- try {
|
|
|
+// try {
|
|
|
// 写文件到磁盘
|
|
|
file.transferTo(newFile);
|
|
|
Attachment attachment = new Attachment();
|
|
|
@@ -182,10 +182,10 @@ public class FileUploadController extends BaseController {
|
|
|
attachment.setDownload_uri(getFileDownloadUri());
|
|
|
attachmentService.insertAndGetId(attachment);
|
|
|
return ResponseEntity.status(HttpStatus.OK).body(attachment.getId().toString());
|
|
|
- } catch (IOException e) {
|
|
|
- log.error("上传文件错误!{}", e);
|
|
|
- return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("上传文件错误");
|
|
|
- }
|
|
|
+// } catch (IOException e) {
|
|
|
+// log.error("上传文件错误!{}", e);
|
|
|
+// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("上传文件错误");
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/uploadFile")
|