Upload File
Provides a file upload widget for users in chat interfaces.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Session Id - Unique identifier for the UI client connection.
- Local Directory - Local directory to save uploaded files.
- Label - Optional label for the upload widget.
- Description - Optional description for the upload widget.
Options
- Acceptable Extensions - Optional list of acceptable file extensions.
- Max File Size - Optional maximum file size limit.
- Mode - Specifies the upload mode. Can be either "Single" or "Multiple".
Output
- File - Information about the uploaded file(s).
How It Works
The Upload File node creates a widget that allows users to upload files. When executed, the node:
- Validates the provided Session ID and Local Directory
- Checks that the session is not in conversational mode
- Creates an upload file widget with the specified label, description, acceptable extensions, max file size, and mode
- Sends the widget to the client with the specified session ID
- Waits for the user to upload file(s)
- Parses the response as JSON containing file information
- Downloads the uploaded files to the specified local directory
- Returns file information as the result
Requirements
- A valid session ID for an active client connection
- Valid local directory path for saving uploaded files
- Properly configured client interface that can handle file upload widgets
- Session must not be in conversational mode
- Valid app, instance, and run IDs in the session
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Session ID
- Session not found for the provided ID
- Local Directory is required but not provided
- Local Directory is empty
- Cannot use upload file in conversational mode
- Failed to send widget to client
- Timeout while waiting for user upload
- Failed to parse response as JSON
- No files found in response
- App ID, Instance ID, and Run ID are required but missing
- Failed to download file
Usage Notes
- The Session ID must match an active client connection
- The Local Directory must be a valid path where the system can save files
- The Label and Description fields are optional but can help users understand what files they should upload
- The Acceptable Extensions option limits the types of files that can be uploaded
- The Max File Size option limits the size of files that can be uploaded
- In Single mode, users can only upload one file
- In Multiple mode, users can upload multiple files
- The returned file information includes details about each uploaded file
- Upload file widgets cannot be used in conversational mode