Created
January 10, 2020 17:50
-
-
Save facundovictor/a0a1c505ad849c391a67ba9ba602fa7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
S3_BUCKET_NAME="${1?Missing 1st argument bucket Name}" | |
S3_KEY="${2?Missing 2nd argument bucket key}" | |
FILE_PATH="${3?Missing 3rd argument file path}" | |
formated_date=`date -R` | |
content_type="application/octet-stream" | |
curl -v -X PUT -T ${FILE_PATH} \ | |
-H "Host: ${S3_BUCKET_NAME}.s3.amazonaws.com" \ | |
-H "Date: ${formated_date}" \ | |
-H "Content-Type: ${content_type}" \ | |
-H "Expect:100-continue" \ | |
http://${S3_BUCKET_NAME}.s3.amazonaws.com/${S3_KEY} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment