Azure Blob Storage file uploader

Azure Blob Storage file uploader is a button to upload files to Azure Blob Storage. The uploader allows you to set ACL, and specify file type restrictions and MIME types.

File uploader sends user data directly to Azure using Shared Access Signature (SAS). Data sources, on the other hand, send data through UI Bakery servers.

Triggers

Triggers allow you to launch certain actions based on different events.

On Upload Success

Calls for an action when a file is successfully uploaded

Working with uploader

Prerequisite

If you are planning to use the Azure Blob Storage file uploader in UI Bakery, you first need to set up CORS policies for your storage account.

To set them up, navigate to your Storage account settings > Resource sharing (CORS) and select the Blob Service tab. For the cloud version of UI Bakery, add the following configuration:

[
  {
    "AllowedOrigins": ["https://*.uibakery.io"],
    "AllowedMethods": ["DELETE", "GET", "HEAD", "MERGE", "OPTIONS", "PUT", "POST", "PATCH"],
    "AllowedHeaders": ["*"],
    "ExposedHeaders": ["*"],
    "MaxAge": ["0"]
  }
]

If you're using a self-hosted or managed version of UI Bakery on a custom domain, use the domain where you run your UI Bakery platform in the AllowedOrigins section. Usually, it equals the value of the UI_BAKERY_APP_SERVER_NAME environment variable.

To upload files to Azure Blob Storage:

  1. Add the Azure Blob Storage file uploader component to the working area.

  2. Connect your Azure Blob Storage data source or select one from the dropdown if you have previously connected it.

  3. Specify the container and set up other required settings.

  1. Next, click on the component and select the necessary file to upload it.

Once it's uploaded, you will notice that the lastUploadedFileUrl is an Azure Blob Storage URL, and you can refer to it with the {{ui.fileUploader.lastUploadedFileUrl}} variable.

Also, if you need to call any action upon the file upload, you can use the On Upload Success trigger of the component.

Last updated

Was this helpful?