Skip to content

Instantly share code, notes, and snippets.

@facundovictor
Created January 10, 2020 17:50
Show Gist options
  • Save facundovictor/a0a1c505ad849c391a67ba9ba602fa7c to your computer and use it in GitHub Desktop.
Save facundovictor/a0a1c505ad849c391a67ba9ba602fa7c to your computer and use it in GitHub Desktop.
#!/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