Overview

The Upload File Block is a user input component that prompts users to upload a file. It’s designed to wait for the user to select and upload a file before proceeding with the workflow. This block is particularly useful when you need to incorporate user-provided files into your flow for further processing or analysis.

Inputs

questions
string[]

The questions/prompts to display to the user. Only available when “Use Input” is enabled.

wait
any

A value to wait for before showing the file upload prompt. Only available when “Wait For Input” is enabled.

Outputs

output
file

The uploaded file data. This can be used in subsequent blocks for processing or analysis.

Editor Settings

prompt
string
default:"This is an example question?"

The message displayed to the user when prompted to upload a file. Only editable when “Use Input” is disabled.

useInput
boolean
default:false

When enabled, allows the prompt message to be provided via the questions input port instead of the editor settings.

useWaitForInput
boolean
default:false

When enabled, delays showing the file upload prompt until the “Wait For” input receives a value.

acceptedFileTypes
string[]

The file types that the block will accept. Default supported types:

  • PDF files (application/pdf)
  • Microsoft Word documents (application/msword)
  • CSV files (text/csv)
  • Modern Word documents (.docx)

Example: Uploading a CSV for Analysis

  1. Add an Upload File Block to your flow.
  2. Set the prompt to “Please upload a CSV file for analysis”.
  3. Connect the output to subsequent blocks to process the uploaded file.
  4. When the flow runs, users will be prompted to upload a file matching the accepted types.

Error Handling

  • If a user attempts to upload a file type that is not in the accepted file types list, the block will display an error message and continue waiting for a valid file.
  • If there are issues with file upload (e.g., network errors, file corruption), the block will fail and provide error details.

Always validate and sanitize uploaded files before processing them further in your workflow to ensure security and data integrity.

FAQ

See Also