|
@@ -68,6 +68,19 @@ public class FileServiceImpl implements FileService {
|
|
|
|
|
|
@Override
|
|
|
public String sliceUploadFile(String fileName, MultipartFile file) {
|
|
|
+ String[] split = fileName.split("/");
|
|
|
+ String fileNameOrigin = "";
|
|
|
+ String fileTypePath = "";
|
|
|
+ if(split.length > 0){
|
|
|
+ fileTypePath = fileName.substring(0, fileName.lastIndexOf('/'));
|
|
|
+ fileNameOrigin = fileName.substring(fileName.lastIndexOf('/') + 1, fileName.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ return FileUtil.save(fileSaveRootPath + fileTypePath, file, fileNameOrigin);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return null;
|
|
|
}
|
|
|
|