각 파트의 크기가 최소 5MB(5,242,880 바이트) 이상이여야 합니다.
aws s3 mb s3://s3-mt-bucket
Shell
복사
BUCKET="s3-mt-bucket"
KEY="100mb-fake.zip"
Shell
복사
UPLOAD_ID=$(aws s3api create-multipart-upload --bucket $BUCKET --key $KEY --query 'UploadId' --output text)
Shell
복사
•
출력되는 값의 UploadId 를 저장합니다.
split -b 40M 100mb-fake.zip
Shell
복사
•
파일을 여러 개의 파트로 나눠 업로드
aws s3api upload-part --bucket $BUCKET --key $KEY --part-number 1 --body xaa --upload-id $UPLOAD_ID
aws s3api upload-part --bucket $BUCKET --key $KEY --part-number 2 --body xab --upload-id $UPLOAD_ID
aws s3api upload-part --bucket $BUCKET --key $KEY --part-number 3 --body xac --upload-id $UPLOAD_ID
Shell
복사
•
출력된 ETag들을 확인하고 Part 수에 맞춰 아래와 같이 파일 생성
cat << EOF > parts.json
{
"Parts": [
{
"PartNumber": 1,
"ETag": "\"2d042cbb760bd14a5c23435a635098bb\""
},
{
"PartNumber": 2,
"ETag": "\"ffd66439ae808df759320532c10e4fd0\""
},
{
"PartNumber": 3,
"ETag": "\"c1b5a01396081f8c4997b7e8f6c192c9\""
}
]
}
EOF
Shell
복사
•
업로드 완료 요청
aws s3api complete-multipart-upload --bucket $BUCKET --key $KEY --upload-id $UPLOAD_ID --multipart-upload file://parts.json
Shell
복사





