{"record":{"id":"b91cf560dce74abf","repo":"FlowiseAI/Flowise","slug":"file-upload-is-required","errorCode":null,"errorMessage":"File upload is required","messagePattern":"File upload is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/Unstructured/UnstructuredFile.ts","lineNumber":548,"sourceCode":"                }\n            } else {\n                if (fileBase64.startsWith('[') && fileBase64.endsWith(']')) {\n                    files = JSON.parse(fileBase64)\n                } else {\n                    files = [fileBase64]\n                }\n\n                for (const file of files) {\n                    if (!file) continue\n                    const splitDataURI = file.split(',')\n                    const filename = splitDataURI.pop()?.split(':')[1] ?? ''\n                    const bf = Buffer.from(splitDataURI.pop() || '', 'base64')\n                    const loaderDocs = await loader.loadAndSplitBuffer(bf, filename)\n                    docs.push(...loaderDocs)\n                }\n            }\n        } else {\n            throw new Error('File upload is required')\n        }\n\n        if (metadata) {\n            const parsedMetadata = typeof metadata === 'object' ? metadata : JSON.parse(metadata)\n            docs = docs.map((doc) => ({\n                ...doc,\n                metadata:\n                    _omitMetadataKeys === '*'\n                        ? {\n                              ...parsedMetadata\n                          }\n                        : omit(\n                              {\n                                  ...doc.metadata,\n                                  ...parsedMetadata,\n                                  [sourceIdKey]: doc.metadata[sourceIdKey] || sourceIdKey\n                              },\n                              omitMetadataKeys","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/Unstructured/UnstructuredFile.ts#L530-L566","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n} else {\n    throw new Error('File upload is required')\n}\n\n// after\n} else if (Array.isArray(files) && files.length === 0) {\n    return [] // nothing to do\n} else {\n    throw new Error('File upload is required: pass a non-empty array of base64 data-URI files')\n}","handlingStrategy":"validation","validationCode":"if (!Array.isArray(files) || files.length === 0 || files.every(f => !f)) {\n    throw new Error('UnstructuredFile requires at least one base64 data-URI file')\n}","typeGuard":"function isNonEmptyFileArray(v: unknown): v is string[] {\n    return Array.isArray(v) && v.length > 0 && v.every(f => typeof f === 'string' && f.startsWith('data:'))\n}","tryCatchPattern":"if (!isNonEmptyFileArray(files)) {\n    // skip node or surface friendly message instead of throwing\n    return []\n}","preventionTips":["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."],"tags":["unstructured","validation","input-required"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}