Tuesday, June 13, 2023

upload file to OCI bucket from source server and download file from OCI object storage bucket to target server using curl command

 Step 1:
Right upper corner click on user icon

  --you can see you login id : testing01@gmail.com click on it   
    --Profile page will be open
  -- left bottom resource pannel --> Auth Tocken --> click on it
     --> Generate Tocken --> specify description --> Generate token
   --> copy Generated token
Step 2
GO to Object storage bucket
Click on bucket my case TESTING_BUCKET ( Bucket is already created)
Left bottom there is resource pannel 
      --> click on Pre-Authenticated Requests
     --> create Pre-Authenticated Requests
   --->  specify name 
      --> click on  objects 
     --> write object name in text box which you to upload (exactly same name with extention)
   --> specify access type
      --> bottom click on create Pre-Authenticated Requests
    --> It will shows a url you have to copy it

--upload file to object storage bucket
curl -v -X PUT -u '<user_email_id>:<Token Generated in Step1>' --upload-file <source location with file name> <url generated in step 2>

curl -v -X PUT -u 'testing01@gmail.com:7wZp)x9AdD8xU5mJ.lx4' --upload-file C:\Users\DILIP_BAKSHI\test.txt https://objectstorage.region_o1.oraclecloud.com/p/SBuPvuS-c5aBkS5QVxVzzAd63dXZ-OvrHOTYmCcOhaR5hAfBEy4RKXjUkZ0bSh9y/n/idymarmujn0t/b/TESTING_BUCKET/o/test.txt

--download file from object storage to target server
curl -X GET https://objectstorage.region_o1.oraclecloud.com/p/SBuPvuS-c5aBkS5QVxVzzAd63dXZ-OvrHOTYmCcOhaR5hAfBEy4RKXjUkZ0bSh9y/n/idymarmujn0t/b/TESTING_BUCKET/o/test.txt -o /u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log/test.txt