Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #autor: Barrios J Manu
- #Desc: Sube cosas a un bucket publico S3
- #upload image
- wget https://mediarouting.vestahub.com/Media/94703548/box/270x406 > header.txt
- mv 270x406 270x406.jpg
- date='date +%Y%m%d'
- dateFormatted='date -R'
- s3Bucket="balde"
- fileName="270x406.jpg"
- relativePath="/${s3Bucket}/${fileName}"
- contentType="image/jpg"
- curl -X PUT -T "${fileName}" \
- -H "Host: ${s3Bucket}.s3.amazonaws.com" \
- -H "Date: ${dateFormatted}" \
- -H "Content-Type: ${contentType}" \
- https://${s3Bucket}.s3.amazonaws.com/${fileName}
- #capturing and upload the header
- fileName2="header.txt"
- contentType2="text/plain"
- curl -X PUT -T "${fileName2}" \
- -H "Host: ${s3Bucket}.s3.amazonaws.com" \
- -H "Date: ${dateFormatted}" \
- -H "Content-Type: ${contentType2}" \
- https://${s3Bucket}.s3.amazonaws.com/${fileName2}
- #greps, for cache and cfid
- cat header.txt | grep X-Cache
- cat header.txt | grep x-amz-cf-id > cfid.txt
- #upload cfid
- fileName3="cfid.txt"
- curl -X PUT -T "${fileName3}" \
- -H "Host: ${s3Bucket}.s3.amazonaws.com" \
- -H "Date: ${dateFormatted}" \
- -H "Content-Type: ${contentType2}" \
- https://${s3Bucket}.s3.amazonaws.com/${fileName3}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement