{"record":{"id":"669d9271cb1f24a4","repo":"infiniflow/ragflow","slug":"this-type-of-file-has-not-been-supported-yet","errorCode":null,"errorMessage":"This type of file has not been supported yet!","messagePattern":"This type of file has not been supported yet!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"api/db/services/file_service.py","lineNumber":598,"sourceCode":"                    new_hash = incoming_fp or xxhash.xxh128(blob).hexdigest()\n                    old_hash = doc.content_hash or \"\"\n                    settings.STORAGE_IMPL.put(kb.id, doc.location, blob, kb.tenant_id)\n                    doc.size = len(blob)\n                    doc.content_hash = new_hash\n                    doc = doc.to_dict()\n                    DocumentService.update_by_id(doc[\"id\"], doc)\n                    if new_hash != old_hash:\n                        files.append((doc, blob))\n                except Exception as exc:\n                    logger.exception(\"Failed to update document %s\", doc_id)\n                    err.append(file.filename + \": \" + str(exc))\n                continue\n            try:\n                DocumentService.check_doc_health(kb.tenant_id, file.filename)\n                filename = duplicate_name(DocumentService.query, name=file.filename, kb_id=kb.id)\n                filetype = filename_type(filename)\n                if filetype == FileType.OTHER.value:\n                    raise RuntimeError(\"This type of file has not been supported yet!\")\n\n                location = filename if not safe_parent_path else f\"{safe_parent_path}/{filename}\"\n                while settings.STORAGE_IMPL.obj_exist(kb.id, location):\n                    location += \"_\"\n\n                blob = file.read()\n                if filetype == FileType.PDF.value:\n                    blob = read_potential_broken_pdf(blob)\n                settings.STORAGE_IMPL.put(kb.id, location, blob)\n\n                img = thumbnail_img(filename, blob)\n                thumbnail_location = \"\"\n                if img is not None:\n                    thumbnail_location = f\"thumbnail_{doc_id}.png\"\n                    settings.STORAGE_IMPL.put(kb.id, thumbnail_location, img)\n\n                incoming_fp = getattr(file, \"fingerprint\", None)\n                doc = {","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/db/services/file_service.py#L580-L616","documentation":"Raised during document upload in upload_document when filename_type() classifies the file as FileType.OTHER, i.e. the extension/MIME is not in RAGFlow's supported set (pdf, doc/docx, xlsx, ppt, images, txt/md, html, json, etc.). It is a validation error, not a system fault.","triggerScenarios":"Uploading a file whose extension is unsupported (e.g. .exe, .zip, .csv depending on build, .mp4) via the web upload or the upload API; also files with no extension or a renamed extension that content sniffing rejects.","commonSituations":"Users uploading archives, binaries, or media; automated pipelines forwarding any office attachment; extension renamed to something unsupported before upload.","solutions":["Convert the file to a supported format first (e.g. extract text to .md/.txt, convert .csv to .xlsx).","Check api/utils/file_utils.py filename_type for the exact accepted extension list in your version and rename accordingly.","Reject unsupported files client-side before upload based on extension.","If the format is genuinely needed, request/add support or pre-process outside RAGFlow and upload the text output."],"exampleFix":"# before\nupload('presentation.key')  # unsupported -> RuntimeError\n\n# after\n# convert to a supported format first, then upload\nsubprocess.run(['libreoffice', '--convert-to', 'pptx', 'presentation.key'])\nupload('presentation.pptx')","handlingStrategy":"validation","validationCode":"SUPPORTED = {'.pdf', '.doc', '.docx', '.xlsx', '.xls', '.ppt', '.pptx', '.txt', '.md', '.jpg', '.jpeg', '.png', '.html', '.json'}\next = os.path.splitext(filename)[1].lower()\nif ext not in SUPPORTED:\n    return json_error_response(f'unsupported file type: {ext}', 400)","typeGuard":"from api.utils.file_utils import filename_type\nfrom api.db import FileType\n\ndef is_supported_upload(filename: str) -> bool:\n    return filename_type(filename) != FileType.OTHER.value","tryCatchPattern":"try:\n    errs, files = FileService.upload_document(kb, file_objs, user_id)\nexcept RuntimeError as e:\n    if 'not been supported' in str(e):\n        return json_error_response('unsupported file type', 400)\n    raise","preventionTips":["Filter uploads by extension in the client before POSTing.","Convert exotic formats to supported ones upstream of RAGFlow.","Consult filename_type in api/utils/file_utils.py for the authoritative list per version."],"tags":["validation","file-type","upload","unsupported-format"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}