Thursday, January 17, 2019

Tip To Upload Files Into OCI Object Storage with Pre-Authenticated Requests

Symptom:

 Sometimes we need to provide many files to customers and customers need to provide files to us.
We can use OCI Object Storage Pre-Authenticated Requests to share data. Please refer more details on  Oracle Blog
    However after I create bucket Pre-Authenticated Requests , copy and paste url into our browser, we get below error

{"code":"NotFound","message":"Not Found"}

Solution:

The object Pre-Authenticated Requests can be writing or reading or both. 
The bucket Pre-Authenticated Requests is for writing purpose only (not reading)
So we need to use curl or other tools to put objects into the bucket. ie

curl https://objectstorage.us-ashburn-1.oraclecloud.com/p/THVqAQC1oIiwmerj6aK1lY5q3xG-rK3iGZvM2b1kq0/n/testtest/b/testdata/o/ --upload-file  mydata.tar

1 comment:

Unknown said...

Henry, I was stuck on the same error message. I used the curl GET command from the OCI documents and it did not work. Yours did! Thank you!