Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/common/handle/impl/text/pdf_split_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def handle(
get_buffer,
save_image,
):
buffer = get_buffer(file)
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
# 将上传的文件保存到临时文件中
for chunk in file.chunks():
temp_file.write(chunk)
temp_file.write(buffer)
# 获取临时文件的路径
temp_file_path = temp_file.name

Expand Down
5 changes: 3 additions & 2 deletions apps/common/handle/impl/text/zip_split_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from common.handle.impl.text.xls_split_handle import XlsSplitHandle
from common.handle.impl.text.xlsx_split_handle import XlsxSplitHandle
from common.utils.common import parse_md_file_link, parse_md_image
from common.utils.logger import maxkb_logger


class FileBufferHandle:
Expand Down Expand Up @@ -170,8 +171,8 @@ def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_bu
result = [*result, *value]
else:
result.append(value)
except Exception:
pass
except Exception as e:
maxkb_logger.warning(f"Zip member: {file}, split error: {e}")
image_list = get_image_list(result, files)
result = filter_image_file(result, image_list)
image_mode_list = []
Expand Down