diff --git a/src/main/java/ru/soune/nocopy/service/file/cloud/CloudStorageService.java b/src/main/java/ru/soune/nocopy/service/file/cloud/CloudStorageService.java index d508e41..75ae8b3 100644 --- a/src/main/java/ru/soune/nocopy/service/file/cloud/CloudStorageService.java +++ b/src/main/java/ru/soune/nocopy/service/file/cloud/CloudStorageService.java @@ -65,10 +65,22 @@ public class CloudStorageService { .key(filePath) .contentType(contentType) .build(); - + log.info("putObjectRequest: " + putObjectRequest); try { + log.info("sendToCloudFilePath: " + sendToCloudFilePath); + log.info("sendToCloudFilePath: " + sendToCloudFilePath); + log.info("sendToCloudFilePath: " + sendToCloudFilePath); + log.info("sendToCloudFilePath: " + sendToCloudFilePath); + log.info("sendToCloudFilePath: " + sendToCloudFilePath); + byte[] bytes = Files.readAllBytes(Paths.get(sendToCloudFilePath)); + + log.info("bytes: " + bytes.length); + log.info("bytes: " + bytes.length); + log.info("bytes: " + bytes.length); + log.info("bytes: " + bytes.length); + log.info("bytes: " + bytes.length); s3Client.putObject(putObjectRequest, - RequestBody.fromBytes(Files.readAllBytes(Paths.get(sendToCloudFilePath)))); + RequestBody.fromBytes(bytes)); Files.deleteIfExists(Paths.get(sendToCloudFilePath)); } catch (IOException e) { log.error("Failed to read file: {}", filePath, e);