|
@@ -552,7 +552,9 @@ public class OSSLogicImpl implements OSSLogic {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
try {
|
|
|
inputStream = file.getInputStream();
|
|
|
- File localFile = new File("/Users/diors.po/Desktop/" + "slides/" + file.getOriginalFilename());
|
|
|
+ File localFile = new File(SAVE_PATH + "slides/" + file.getOriginalFilename());
|
|
|
+ if (!localFile.getParentFile().exists())
|
|
|
+ localFile.getParentFile().mkdirs();
|
|
|
FileUtils.copyInputStreamToFile(inputStream, localFile);
|
|
|
String slidesUrl = uploadByUrl("mooctest-course",
|
|
|
"slides/"+file.getOriginalFilename(), new FileInputStream(localFile));
|
|
@@ -572,6 +574,7 @@ public class OSSLogicImpl implements OSSLogic {
|
|
|
result.put("imagesUrl", imagesUrl);
|
|
|
inputStream.close();
|
|
|
imagePath.delete();
|
|
|
+ localFile.delete();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|