anish anil
anish anil

Reputation: 2641

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

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

Upvotes: 0

Views: 670

Answers (1)

data_henrik
data_henrik

Reputation: 17176

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

Upvotes: 2

Related Questions