8f4ba851 by chentao

no message

1 parent 05d3b9f4
......@@ -308,6 +308,7 @@ public class CourseController extends BaseController {
} else {
String originalfileName = sysOss.getOriginalName();
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
log.info("==========suffix=========="+suffix);
UploadResult uploadResult = null;
if (".pdf".equals(suffix)) {
byte[] fileBytes = null;
......@@ -347,6 +348,7 @@ public class CourseController extends BaseController {
byte[] fileBytes = null;
try {
InputStream inputStream = storage.getObjectContent(sysOss.getUrl());
log.info("======inputStream===="+inputStream.available());
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小
int bytesRead;
......@@ -356,6 +358,7 @@ public class CourseController extends BaseController {
byteArrayOutputStream.flush();
fileBytes = byteArrayOutputStream.toByteArray();
byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
log.info("======fileBytes.length===="+fileBytes.length);
uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
log.info("json==============="+uploadResult.getUrl());
} catch (Exception e) {
......
......@@ -217,6 +217,8 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
// else{
// uploadResult = storage.upload(file.getBytes(), originalfileName, file.getContentType());
// }
log.info("==========originalfileName========="+originalfileName);
log.info("==========getContentType========="+file.getContentType());
uploadResult = storage.upload(file.getBytes(), originalfileName, file.getContentType());
} catch (IOException e) {
throw new ServiceException(e.getMessage());
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!