> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odella.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File Block

> Allow users to upload files for use in your workflow

<Frame>
  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/upload_file_light.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=bdad4016399b680ec3af8b5d26ac41d7" alt="Upload File Block Screenshot" className="block dark:hidden" width="684" height="304" data-path="block-reference/assets/upload_file_light.png" />

  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/upload_file_dark.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=d98eb47096237e4fe5aa312a742d465a" alt="Upload File Block Screenshot" className="hidden dark:block" width="698" height="310" data-path="block-reference/assets/upload_file_dark.png" />
</Frame>

## 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

<ParamField path="questions" type="string[]" optional>
  The questions/prompts to display to the user. Only available when "Use Input" is enabled.
</ParamField>

<ParamField path="wait" type="any" optional>
  A value to wait for before showing the file upload prompt. Only available when "Wait For Input" is enabled.
</ParamField>

## Outputs

<ResponseField name="output" type="file">
  The uploaded file data. This can be used in subsequent blocks for processing or analysis.
</ResponseField>

## Editor Settings

<ParamField path="prompt" type="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.
</ParamField>

<ParamField path="useInput" type="boolean" default={false}>
  When enabled, allows the prompt message to be provided via the questions input port instead of the editor settings.
</ParamField>

<ParamField path="useWaitForInput" type="boolean" default={false}>
  When enabled, delays showing the file upload prompt until the "Wait For" input receives a value.
</ParamField>

<ParamField path="acceptedFileTypes" type="string[]" default={["application/pdf", "application/msword", "text/csv", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]}>
  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)
</ParamField>

## 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.

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

## FAQ

<AccordionGroup>
  <Accordion title="What's the difference between using the prompt setting vs input?">
    When "Use Input" is disabled, the prompt message is set statically in the editor settings. When enabled, the prompts can be dynamically provided via the questions input port.
  </Accordion>

  <Accordion title="How does the Wait For Input feature work?">
    When "Wait For Input" is enabled, the file upload prompt won't be shown until a value is received on the "Wait For" input port. This allows you to sequence file uploads after other operations complete.
  </Accordion>

  <Accordion title="What file types are supported?">
    By default, the block accepts PDF files, Microsoft Word documents (both .doc and .docx formats), and CSV files. The accepted file types are configured through the MIME types in the block settings.
  </Accordion>
</AccordionGroup>

## See Also

* [Table Block](/block-reference/loaders/read-table)
* [Text Block](/block-reference/data/text)
* [File Block](/block-reference/data/file)
