feat: Add support for Mammoth library for docx file uploads

This commit is contained in:
n4ze3m
2024-05-24 18:26:28 +05:30
parent 845b725970
commit 8899a42331
13 changed files with 130 additions and 20 deletions

View File

@@ -90,15 +90,16 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
return e?.fileList
}}>
<Upload.Dragger
accept={".pdf, .csv, .txt, .md"}
accept={".pdf, .csv, .txt, .md, .docx"}
multiple={true}
maxCount={10}
beforeUpload={(file) => {
const allowedTypes = [
"application/pdf",
// "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/csv",
"text/plain"
"text/plain",
"text/markdown",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
.map((type) => type.toLowerCase())
.join(", ")