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
- Place the [File] element.
- Click [Select file] and choose the file.
Creating a Dataflow
- Click [Create] next to [Dataflows].
- Select any data source that is integrated with Amazon S3.
- Select Uploadfor [Action].
- Enter the Bucket name to use in [Bucket].
- Enter {{ file1.value[0].data }}in [Body].
- Enter {{ file1.value[0].name }}in [Key].
- Enter {{ file1.value.[0].contentType }}in [Content type].
Linking Dataflow to Button
- Place the [Button] element.
- Click [Add].
- Select dataflow1under [Dataflow].
- Select the file again.
- Click the [Button] to upload the file.
Checking Uploaded Files
- Click [Create] in [Dataflows].
- Select a data source integrated with [Amazon S3].
- Select List objectsfor [Action].
- Enter the Bucket name to use in [Bucket].
- Click [Run] to run.
- Place the [Column] element.
- Place [Table] to the left of [Column].
- Adjust the width and place the previously positioned [File] and [Button] to the right of [Column].
- Enter {{ dataflow2.data.Contents }}in [Data] in [Inspect].
Checking the Contents of the File with Text and Image
- Place the [Text] element.
- Enter {{ table1.selectedRow.data.Key }}in [Text] in [Inspect].
- Place the [Image] element.
- Enter the URL {{ "https://[Bucket Name].s3.[Region].amazonaws.com/" + table1.selectedRow.data.Key }}in [URL] in [Inspect].
- Ensure that the file information selected in table1is displayed.
Uploading Files in multipart/form-data Format
Selecting the File
- Place the [File] element.
- Click [Select files] and choose the file.
Creating a Dataflow
- Click [Create] in [Dataflows].
- Select any data source integrated with a REST API.
- Choose POSTfor [Method].
- Enter the endpoint for file uploads in [Path].
- Select Form Datafor [Body type].
- Add parameters and switch from TexttoFile.
- Enter any key name accepted by the API in [Key].
- 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.