Documentation
Apps
Components
How to Use File

How to Use File

Uploading Multiple Files

To upload multiple files, change the value of [Allow multiple files] from false to true.

Making File Upload Mandatory

To make file upload mandatory, check [Required].

Uploading Files to Amazon S3

Selecting the File

  1. Place the [File] element.
  2. Click [Select file] and choose the file.

Creating a Dataflow

  1. Click [Create] next to [Dataflows].
  2. Select any data source that is integrated with Amazon S3.
  3. Select Upload for [Action].
  4. Enter the Bucket name to use in [Bucket].
  5. Enter {{ file1.value[0].data }} in [Body].
  6. Enter {{ file1.value[0].name }} in [Key].
  7. Enter {{ file1.value.[0].contentType }} in [Content type].

Linking Dataflow to Button

  1. Place the [Button] element.
  2. Click [Add].
  3. Select dataflow1 under [Dataflow].
  4. Select the file again.
  5. Click the [Button] to upload the file.

Checking Uploaded Files

  1. Click [Create] in [Dataflows].
  2. Select a data source integrated with [Amazon S3].
  3. Select List objects for [Action].
  4. Enter the Bucket name to use in [Bucket].
  5. Click [Run] to run.
  6. Place the [Column] element.
  7. Place [Table] to the left of [Column].
  8. Adjust the width and place the previously positioned [File] and [Button] to the right of [Column].
  9. Enter {{ dataflow2.data.Contents }} in [Data] in [Inspect].

Checking the Contents of the File with Text and Image

  1. Place the [Text] element.
  2. Enter {{ table1.selectedRow.data.Key }} in [Text] in [Inspect].
  3. Place the [Image] element.
  4. Enter the URL {{ "https://[Bucket Name].s3.[Region].amazonaws.com/" + table1.selectedRow.data.Key }} in [URL] in [Inspect].
  5. Ensure that the file information selected in table1 is displayed.

Uploading Files in multipart/form-data Format

Selecting the File

  1. Place the [File] element.
  2. Click [Select files] and choose the file.

Creating a Dataflow

  1. Click [Create] in [Dataflows].
  2. Select any data source integrated with a REST API.
  3. Choose POST for [Method].
  4. Enter the endpoint for file uploads in [Path].
  5. Select Form Data for [Body type].
  6. Add parameters and switch from Text to File.
  7. Enter any key name accepted by the API in [Key].
  8. Enter {{ file1.value[0] }} in [Value].

Note: Files are treated as Base64-encoded strings on the product but are converted to multipart/form-data format before the API request is made.