Unable to upload a zip file into the IBM Cloud S3 bucket

619 Views Asked by At

Unable to upload a zip file into the IBM Cloud S3 bucket

Hello Team,

This one is critical for our automation and we are stuck as we dont have the correct syntax to upload a file to the bucket we created. We are trying to upload a zip file into the bucket.

Documentation being refereed: https://cloud.ibm.com/docs/services/cloud-object-storage/cli?topic=cloud-object-storage-curl#curl-put-object

curl -X "PUT" "https://(endpoint)/(bucket-name)/(object-key)" -H "Authorization: bearer (token)" -H "Content-Type: (content-type)" -d "(object-contents)"

We have the bearer token and i presume the object key is the actual zip file. We are unable to understand what needs to be replaced in content type and object contents.

Could you please site one with an example so we can move ahead on this issue.

Thank you

1

There are 1 best solutions below

0
On

The standard for zip files is application/zip.

curl -X "PUT" "https://s3.eu.cloud-object-storage.appdomain.cloud/mybucket/archive.zip" \
       -H "Authorization: Bearer $COS_ADMIN_TOKEN" \
       -H "Content-Type: application/zip" \
       -T archive.zip