{"record":{"id":"8df3d2470563f4bc","repo":"FlowiseAI/Flowise","slug":"unsupported-binary-file-type-mimetype-8df3d2","errorCode":null,"errorMessage":"Unsupported binary file type: ${mimeType}","messagePattern":"Unsupported binary file type: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/S3File/S3File.ts","lineNumber":956,"sourceCode":"                case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n                case 'application/vnd.ms-excel': {\n                    const excelLoader = new LoadOfSheet(tempFilePath)\n                    docs = await excelLoader.load()\n                    break\n                }\n                case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':\n                case 'application/vnd.ms-powerpoint': {\n                    const pptxLoader = new PowerpointLoader(tempFilePath)\n                    docs = await pptxLoader.load()\n                    break\n                }\n                case 'text/csv': {\n                    const csvLoader = new CSVLoader(tempFilePath)\n                    docs = await csvLoader.load()\n                    break\n                }\n                default:\n                    throw new Error(`Unsupported binary file type: ${mimeType}`)\n            }\n\n            // Add S3 metadata to each document\n            if (docs.length > 0) {\n                const s3Metadata = {\n                    source: fileInfo.webViewLink,\n                    fileId: fileInfo.key,\n                    fileName: fileInfo.name,\n                    mimeType: fileInfo.mimeType,\n                    size: fileInfo.size,\n                    lastModified: fileInfo.lastModified,\n                    etag: fileInfo.etag,\n                    bucketName: fileInfo.bucketName,\n                    totalPages: docs.length // Total number of pages/sheets in the file\n                }\n\n                return docs.map((doc, index) => ({\n                    ...doc,","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/S3File/S3File.ts#L938-L974","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ndefault:\n    throw new Error(`Unsupported binary file type: ${mimeType}`)\n\n// after\ncase 'text/plain': {\n    const txt = fsDefault.readFileSync(tempFilePath, 'utf-8')\n    docs = [{ pageContent: txt, metadata: {} } as any]\n    break\n}\ndefault:\n    throw new Error(`Unsupported binary file type: ${mimeType}`)","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set([\n    'application/pdf',\n    'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n    'application/msword',\n    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n    'application/vnd.ms-excel',\n    'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n    'application/vnd.ms-powerpoint',\n    'text/csv',\n])\nconst mime = fileInfo.mimeType.toLowerCase()\nif (!SUPPORTED.has(mime)) {\n    throw new Error(`Pre-check: MIME '${mime}' not supported. Convert the file first.`)\n}","typeGuard":"function isSupportedBinaryMime(mime: string): boolean {\n    return [\n        'application/pdf',\n        'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n        'application/msword',\n        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n        'application/vnd.ms-excel',\n        'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n        'application/vnd.ms-powerpoint',\n        'text/csv',\n    ].includes(mime.toLowerCase())\n}","tryCatchPattern":"try {\n    // process binary file\n} catch (e: any) {\n    if (/Unsupported binary file type/.test(e.message)) {\n        // route to text/unstructured path or skip\n    }\n    throw e\n}","preventionTips":["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."],"tags":["s3","document-loader","mime-type","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}