This commit is contained in:
qingxu fu
2023-07-22 02:25:30 +08:00
parent 505b10965f
commit 4f55dfdc0e
2 changed files with 45 additions and 29 deletions

View File

@ -465,6 +465,10 @@ def find_recent_files(directory):
return recent_files
def clear_file_downloadzone(chatbot):
if chatbot:
chatbot._cookies.update({'file_to_promote': []})
def promote_file_to_downloadzone(file, rename_file=None, chatbot=None):
# 将文件复制一份到下载区
import shutil
@ -479,6 +483,7 @@ def promote_file_to_downloadzone(file, rename_file=None, chatbot=None):
if 'file_to_promote' in chatbot._cookies: current = chatbot._cookies['file_to_promote']
else: current = []
chatbot._cookies.update({'file_to_promote': [new_path] + current})
return new_path
def on_file_uploaded(cookies, files, chatbot, txt, txt2, checkboxes):
"""