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

  1. Confirm the object's actual Content-Type via S3 HEAD and fix the upload metadata if it is wrong.
  2. Convert or pre-process the file into a supported format (pdf/docx/xlsx/pptx/csv).
  3. If the file is plain text, route it through the text loader path instead of the binary path.
  4. 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

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


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