Skip to main content

Upload File

Uploads a local file to Google's Gemini API for use in multimodal operations.

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

  • Connection Id - The connection ID obtained from the Connect node.
  • File Display Name - The display name for the uploaded file (defaults to the file's base name if not provided).
  • File Local Path - The local file system path to the file to be uploaded.

Options

  • Validate File Size - Whether to check file size before upload (max 2GB). Default is true.

Output

  • File - Information about the uploaded file including URI, name, and metadata.

How It Works

The Upload File node uploads a local file to Google's Gemini API for use in multimodal operations. When executed, the node:

  1. Validates the provided connection ID and file path
  2. Checks that the file exists and is not a directory
  3. Validates the file size (maximum 2GB) if validation is enabled
  4. Detects the MIME type of the file
  5. Uploads the file to the Gemini API with progress tracking
  6. Returns detailed information about the uploaded file including URI and metadata

Requirements

  • A valid Google Gemini API key
  • Connection ID from a successful Connect node execution
  • Valid local file path to an existing file
  • File size must not exceed 2GB

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection ID
  • Empty or invalid File Local Path
  • File not found at the specified path
  • Path is a directory instead of a file
  • File size exceeds the maximum allowed size of 2GB
  • Failed to open the file for reading
  • API errors from Google's Gemini service

Usage Notes

  • The file display name defaults to the file's base name if not explicitly provided
  • Upload progress is logged every 5 seconds for large files
  • Uploaded files have expiration times set by the Gemini API
  • The returned file URI is used by other nodes that require file inputs
  • File upload speed is calculated and included in the metadata
  • MIME type is automatically detected based on the file extension
  • Files are uploaded directly to Google's servers and are not stored locally