-
Notifications
You must be signed in to change notification settings - Fork 0
How to use curl with minio
Cesar Celis Hernandez edited this page Mar 22, 2023
·
1 revision
How to use curl with MinIO
cd /Users/cniackz/Desktop
bucket=testing
file=arbol.jpg
host=play.min.io
s3_key='Q3AM3UQ867SPQQA43P2F'
s3_secret='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
resource="/testing/arbol.jpg"
content_type="application/octet-stream"
date=`date -R`
_signature="PUT\n\n${content_type}\n${date}\n${resource}"
signature=`echo -en ${_signature} | openssl sha1 -hmac ${s3_secret} -binary | base64`
curl -v -X PUT -T "${file}" \
-H "Host: $host" \
-H "Date: ${date}" \
-H "Content-Type: ${content_type}" \
-H "Authorization: AWS ${s3_key}:${signature}" \
https://$host${resource}
cd /Users/cniackz/Desktop/temporalnewdiretory
bucket=testing
file=arbol.jpg
host=play.min.io
s3_key='Q3AM3UQ867SPQQA43P2F'
s3_secret='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
resource="/testing/arbol.jpg"
content_type="application/octet-stream"
date=`date -R`
_signature="GET\n\n${content_type}\n${date}\n${resource}"
signature=`echo -en ${_signature} | openssl sha1 -hmac ${s3_secret} -binary | base64`
curl -o ./arbol-2.jpg -v \
-H "Host: $host" \
-H "Date: ${date}" \
-H "Content-Type: ${content_type}" \
-H "Authorization: AWS ${s3_key}:${signature}" \
https://$host${resource}
Cesars-MacBook-Pro:temporalnewdiretory cniackz$ ls
arbol-2.jpg
Cesars-MacBook-Pro:temporalnewdiretory cniackz$ open .