FlowiseAI/Flowise · error · Error

File upload is required

Error message

File upload is required

What it means

Validation in UnstructuredFile loader: the code reached the else branch meaning no files input was supplied. The loader requires at least one base64 data-URI file to partition.

Source

Thrown at packages/components/nodes/documentloaders/Unstructured/UnstructuredFile.ts:548

                }
            } else {
                if (fileBase64.startsWith('[') && fileBase64.endsWith(']')) {
                    files = JSON.parse(fileBase64)
                } else {
                    files = [fileBase64]
                }

                for (const file of files) {
                    if (!file) continue
                    const splitDataURI = file.split(',')
                    const filename = splitDataURI.pop()?.split(':')[1] ?? ''
                    const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
                    const loaderDocs = await loader.loadAndSplitBuffer(bf, filename)
                    docs.push(...loaderDocs)
                }
            }
        } else {
            throw new Error('File upload is required')
        }

        if (metadata) {
            const parsedMetadata = typeof metadata === 'object' ? metadata : JSON.parse(metadata)
            docs = docs.map((doc) => ({
                ...doc,
                metadata:
                    _omitMetadataKeys === '*'
                        ? {
                              ...parsedMetadata
                          }
                        : omit(
                              {
                                  ...doc.metadata,
                                  ...parsedMetadata,
                                  [sourceIdKey]: doc.metadata[sourceIdKey] || sourceIdKey
                              },
                              omitMetadataKeys

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Connect a node that emits base64 data-URI files into the UnstructuredFile files input.
  2. Validate files is a non-empty array before calling the loader and surface a friendly message.
  3. Inspect the upstream node's output to confirm it actually produced file payloads.
  4. Skip the node gracefully when no files are present instead of throwing.

Example fix

// before
} else {
    throw new Error('File upload is required')
}

// after
} else if (Array.isArray(files) && files.length === 0) {
    return [] // nothing to do
} else {
    throw new Error('File upload is required: pass a non-empty array of base64 data-URI files')
}
Defensive patterns

Strategy: validation

Validate before calling

if (!Array.isArray(files) || files.length === 0 || files.every(f => !f)) {
    throw new Error('UnstructuredFile requires at least one base64 data-URI file')
}

Type guard

function isNonEmptyFileArray(v: unknown): v is string[] {
    return Array.isArray(v) && v.length > 0 && v.every(f => typeof f === 'string' && f.startsWith('data:'))
}

Try / catch

if (!isNonEmptyFileArray(files)) {
    // skip node or surface friendly message instead of throwing
    return []
}

Prevention

When it happens

Trigger: Invoking the UnstructuredFile node with an empty or undefined `files` input, a files array of all-null entries that fails the upstream presence check, or a flow wiring mistake that leaves files disconnected.

Common situations: Upstream node produced no file output, the user forgot to attach a File loader, the files value is an empty array after filtering, or a refactor renamed the input field.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/b91cf560dce74abf. Report an issue: GitHub.