Skip to Main Content

API, CLI, SDK & Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to upload file to OSS bucket using Curl with PEM files

Hi,

I am planning to perform an upload to OSS Bucket using curl command with Public and Private keys (PEM files) provided using curl and having issue:

curl -key ~/poa_oci_api_key.pem --pubkey ~/poa_oci_api_key_public.pem -X PUT -x www-proxy.us.oracle.com:80 -T 2.sql -H "Content-Type: plain/text" -H "Content-Length: `wc -c 2.sql|awk '{print $1}'`" "https://objectstorage.us-phoenix-1.oraclecloud.com/n/<namespace>/b/<OSS_bucket>/o/2.sql"

Note: I could perform Download from same OSS bucket with the PEM keys using curl

curl -key ~/poa_oci_api_key.pem --pubkey ~/poa_oci_api_key_public.pem -X GET -x www-proxy.us.oracle.com:80 "https://objectstorage.us-phoenix-1.oraclecloud.com/n/<namespace>/b/<OSS_bucket>/o/test.sql"

Also note, I could also upload with OCI CLI on my local machine; but using curl on my VM (as OCI CLI is unable to be installed for some reason) with the same info is leading to an issue!

Could you please help me with the curl for upload?

Thanks and Regards.,

Sudharsan C

Comments
Post Details
Added on Aug 7 2024
0 comments
447 views