FlowiseAI/Flowise · error · Error
Unsupported binary file type: ${mimeType}
Error message
Unsupported binary file type: ${mimeType} What it means
Thrown by the S3File binary-file processor when the object's MIME type does not match any case in the loader switch (pdf, docx/doc, xlsx/xls, pptx/ppt, csv). The default branch rejects anything else, so the file is never handed to a parser.
Source
Thrown at packages/components/nodes/documentloaders/S3File/S3File.ts:956
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
case 'application/vnd.ms-excel': {
const excelLoader = new LoadOfSheet(tempFilePath)
docs = await excelLoader.load()
break
}
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
case 'application/vnd.ms-powerpoint': {
const pptxLoader = new PowerpointLoader(tempFilePath)
docs = await pptxLoader.load()
break
}
case 'text/csv': {
const csvLoader = new CSVLoader(tempFilePath)
docs = await csvLoader.load()
break
}
default:
throw new Error(`Unsupported binary file type: ${mimeType}`)
}
// Add S3 metadata to each document
if (docs.length > 0) {
const s3Metadata = {
source: fileInfo.webViewLink,
fileId: fileInfo.key,
fileName: fileInfo.name,
mimeType: fileInfo.mimeType,
size: fileInfo.size,
lastModified: fileInfo.lastModified,
etag: fileInfo.etag,
bucketName: fileInfo.bucketName,
totalPages: docs.length // Total number of pages/sheets in the file
}
return docs.map((doc, index) => ({
...doc,View on GitHub (pinned to abe4a8601a)
Solutions
- Confirm the object's actual Content-Type via S3 HEAD and fix the upload metadata if it is wrong.
- Convert or pre-process the file into a supported format (pdf/docx/xlsx/pptx/csv).
- If the file is plain text, route it through the text loader path instead of the binary path.
- Extend the switch (and getMimeTypeFromExtension map) to add the MIME with a matching loader if support is required.
Example fix
// before
default:
throw new Error(`Unsupported binary file type: ${mimeType}`)
// after
case 'text/plain': {
const txt = fsDefault.readFileSync(tempFilePath, 'utf-8')
docs = [{ pageContent: txt, metadata: {} } as any]
break
}
default:
throw new Error(`Unsupported binary file type: ${mimeType}`) Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = new Set([
'application/pdf',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/msword',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.ms-powerpoint',
'text/csv',
])
const mime = fileInfo.mimeType.toLowerCase()
if (!SUPPORTED.has(mime)) {
throw new Error(`Pre-check: MIME '${mime}' not supported. Convert the file first.`)
} Type guard
function isSupportedBinaryMime(mime: string): boolean {
return [
'application/pdf',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/msword',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.ms-powerpoint',
'text/csv',
].includes(mime.toLowerCase())
} Try / catch
try {
// process binary file
} catch (e: any) {
if (/Unsupported binary file type/.test(e.message)) {
// route to text/unstructured path or skip
}
throw e
} Prevention
- Enforce allowed MIME types at S3 upload time via bucket policy.
- Run a HEAD on the object and check Content-Type before invoking the node.
- Keep the supported-MIME set in a shared constant the UI also reads.
- Convert Office files to PDF/docx upstream if the source format varies.
When it happens
Trigger: Loading an S3 object whose reported Content-Type is outside the supported set — e.g. application/json, text/plain, image/png, application/zip, video/mp4, or a custom/proprietary MIME — when the node routes binary files through processBinaryFile.
Common situations: S3 object uploaded with a wrong or generic Content-Type (e.g. binary/octet-stream), plain-text files the user expected to be readable, image/PDF scans stored as image/* , or newer Office formats not yet added to the switch.
Related errors
- Failed to load file ${filePath} using unstructured loader.
- Failed to process binary file: ${error.message}
- chatflowId must be a valid array
- dataset.rows must be a valid array
- Model is required
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/8df3d2470563f4bc.
Report an issue: GitHub.