We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
관리자가 영수증을 첨부할 수 있는 기능을 구현합니다. 1차 목표: 우형 블로그의 방법 중 1가지 적용해서 S3에 영수증을 업로드한다.
9월 9일 (1하루)
implementation 'software.amazon.awssdk:s3:2.25.27'
GET /api/upload
@RestController public class S3UploadController { private final S3UploadService s3UploadService; public S3UploadController(S3UploadService s3UploadService) { this.s3UploadService = s3UploadService; } @GetMapping("/api/upload") public String uploadFile() { String imageName = "test.png"; s3UploadService.uploadImageToS3("techcourse-project-2024", "haeng-dong/s3-upload-test/test-upload.png", new File("/home/ubuntu/" + imageName)); return imageName; } } @Component public class S3UploadService { private final S3Client s3; public S3UploadService() { this.s3 = S3Client.builder() .region(Region.AP_NORTHEAST_2) .build(); } public void uploadImageToS3(String bucketName, String key, File file) { PutObjectRequest putObjectRequest = PutObjectRequest.builder() .bucket(bucketName) .key(key) .build(); s3.putObject(putObjectRequest, RequestBody.fromFile(file)); } }
The text was updated successfully, but these errors were encountered:
3Juhwan
kunsanglee
No branches or pull requests
📄 설명
관리자가 영수증을 첨부할 수 있는 기능을 구현합니다.
1차 목표: 우형 블로그의 방법 중 1가지 적용해서 S3에 영수증을 업로드한다.
🏁 할 일
1차 마일스톤
마일스톤 목표
⏰ 예상 시간
9월 9일 (1하루)
1차 마일스톤 진행 사항
문제
해결 방법
implementation 'software.amazon.awssdk:s3:2.25.27'
를 사용해서, 서버 -> S3로 이미지를 업로드하는 애플리케이션을 구현했다.GET /api/upload
를 요청하면 로컬의 특정 파일이 S3의 /haeng-dong/s3-upload-test 에 업로드 된다.정리
2차 마일스톤
목표
The text was updated successfully, but these errors were encountered: