How To Upload A File From VBCS To OCI Storage Bucket?

How To Upload A File From VBCS To OCI Storage Bucket?

What is OCI Object Storage?

The Oracle Cloud Infrastructure Object Storage service is a robust and scalable storage platform designed to deliver high performance and ensure reliable and cost-effective durability of your data.

Storage buckets serve as logical containers for object storage. Buckets can be created within a specific region as required. Each bucket is linked to a dedicated compartment, which defines policies governing the actions users can take on the bucket and all its contained objects.

Following are some use cases of OCI Object Storage Service:

  1. Backup of Oracle Database to Object Storage for data redundancy and durability.
  2. Storage Gateway file management operations for connecting on-premises applications with OCI.
  3. AI Services
  4. Fast and efficient upload of bulk data from VBCS to Oracle ATP DB.

In this blog, we will see an overview of uploading a file from VBCS to Storage bucket.

Pre-requisites:

  1. Visual Builder Cloud Service Instance
  2. OCI Storage Bucket
  3. Access to read and download objects from Bucket. You can refer to the following documentation for more information on required grants: common policies.

Steps for implementation:

Step 1: Login to the OCI Console and navigate to My Profile Page.

Article content

Step 2: Under API keys section, click Add API key.

Article content
Article content

Download private and public key files and then click on Add.

Article content

Copy and save the API key fingerprint and configuration file for later use before closing

Step 3:  Under Buckets, select the correct compartment and the bucket to be used.

Article content
Article content

Step 4: Copy and save the namespace value to be used while creating service connection in Oracle VBCS.

Article content

Step 5:  Get the PutObject OCI Storage API that will be utilized for creating service connection.

Step 6:  Open your VBCS App. Create a new service connection using the endpoint flow with the following details:

URL – https://[OCI Regional Host]/[version]//n/<namespaceName>/b/{bucketName}/o/{objectName}

Method – PUT

Authentication – OCI API Signature 1.0.

Key Id : Using the configuration file that we saved in step 3, create the Key Id as follows: <tenancy>/<user>/<fingerprint>

Private Key : Paste the contents of Private Key file.

Media Type – application/Json

Response – none

Article content

Add bucketName and objectName path parameters.

Article content

Add the request payload and create endpoint.

Article content

Step 7: In your webApp, drag and drop the File picker component onto the page.  In the properties tab of the File Picker component, use Selection mode as Single.

Article content

Also, create a page variable called file of type Any.

Step 8: Click the events tab, select Selected File event and create an action chain for this event.

Article content

Within the action chain, add an Assign variables action and assign the file variable to input parameter files[0].

Article content

Step 9:  Finally, add a button to the page and put label text as Upload.  Click the events tab, select ojAction event and create an action chain.

Article content

Within the action chain, add the Call Rest action and select the endpoint of the PutObject service connection.

Article content

Map the input parameters bucketName & objectName and the body.

Article content
Article content
Article content

Additionally, we can add an If action to check if the rest call returned a response. No response means the file was uploaded successfully, and the user can be notified success otherwise we can throw error using Fire Notification action.

Result:

Select the file you want to upload and click Upload.

Article content
Article content

Log into OCI and navigate to your bucket to find the uploaded file.

Article content

If you have any questions or concern, kindly leave a comment below or contact us on business@conneqtiongroup.com.




To view or add a comment, sign in

More articles by Conneqtion Group

Insights from the community

Others also viewed

Explore topics