Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
20b932da
Unverified
Commit
20b932da
authored
Feb 20, 2024
by
Jyong
Committed by
GitHub
Feb 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del doc support (#2494)
Co-authored-by:
jyong
<
jyong@dify.ai
>
parent
207080ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
file_extractor.py
api/core/data_loader/file_extractor.py
+2
-2
file_service.py
api/services/file_service.py
+3
-3
No files found.
api/core/data_loader/file_extractor.py
View file @
20b932da
...
...
@@ -69,7 +69,7 @@ class FileExtractor:
else
MarkdownLoader
(
file_path
,
autodetect_encoding
=
True
)
elif
file_extension
in
[
'.htm'
,
'.html'
]:
loader
=
HTMLLoader
(
file_path
)
elif
file_extension
in
[
'.docx'
,
'.doc'
]:
elif
file_extension
in
[
'.docx'
]:
loader
=
Docx2txtLoader
(
file_path
)
elif
file_extension
==
'.csv'
:
loader
=
CSVLoader
(
file_path
,
autodetect_encoding
=
True
)
...
...
@@ -96,7 +96,7 @@ class FileExtractor:
loader
=
MarkdownLoader
(
file_path
,
autodetect_encoding
=
True
)
elif
file_extension
in
[
'.htm'
,
'.html'
]:
loader
=
HTMLLoader
(
file_path
)
elif
file_extension
in
[
'.docx'
,
'.doc'
]:
elif
file_extension
in
[
'.docx'
]:
loader
=
Docx2txtLoader
(
file_path
)
elif
file_extension
==
'.csv'
:
loader
=
CSVLoader
(
file_path
,
autodetect_encoding
=
True
)
...
...
api/services/file_service.py
View file @
20b932da
...
...
@@ -20,9 +20,9 @@ from services.errors.file import FileTooLargeError, UnsupportedFileTypeError
IMAGE_EXTENSIONS
=
[
'jpg'
,
'jpeg'
,
'png'
,
'webp'
,
'gif'
,
'svg'
]
IMAGE_EXTENSIONS
.
extend
([
ext
.
upper
()
for
ext
in
IMAGE_EXTENSIONS
])
ALLOWED_EXTENSIONS
=
[
'txt'
,
'markdown'
,
'md'
,
'pdf'
,
'html'
,
'htm'
,
'xlsx'
,
'docx'
,
'
doc'
,
'
csv'
]
+
IMAGE_EXTENSIONS
ALLOWED_EXTENSIONS
=
[
'txt'
,
'markdown'
,
'md'
,
'pdf'
,
'html'
,
'htm'
,
'xlsx'
,
'docx'
,
'csv'
]
+
IMAGE_EXTENSIONS
UNSTRUSTURED_ALLOWED_EXTENSIONS
=
[
'txt'
,
'markdown'
,
'md'
,
'pdf'
,
'html'
,
'htm'
,
'xlsx'
,
'docx'
,
'doc
'
,
'csv'
,
'eml'
,
'msg'
,
'pptx'
,
'ppt'
,
'xml'
]
+
IMAGE_EXTENSIONS
'docx
'
,
'csv'
,
'eml'
,
'msg'
,
'pptx'
,
'ppt'
,
'xml'
]
+
IMAGE_EXTENSIONS
PREVIEW_WORDS_LIMIT
=
3000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment