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
},
omitMetadataKeysView on GitHub (pinned to abe4a8601a)
Solutions
- Connect a node that emits base64 data-URI files into the UnstructuredFile files input.
- Validate files is a non-empty array before calling the loader and surface a friendly message.
- Inspect the upstream node's output to confirm it actually produced file payloads.
- 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
- Connect a file-producing upstream node before enabling UnstructuredFile.
- Validate files shape at the boundary before delegating to the loader.
- Skip gracefully when zero files rather than throwing, if the flow allows it.
- Add UI feedback when the files input is empty at save time.
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
- Expected partitioning request to return an array, but got ${
- chatflowId must be a valid array
- dataset.rows must be a valid array
- Model is required
- Invalid human input type. Expected 'proceed' or 'reject', bu
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/b91cf560dce74abf.
Report an issue: GitHub.