From 9a606f550d39c0f6ab08453b4e9c93666e82fa63 Mon Sep 17 00:00:00 2001 From: wl-zhao Date: Sun, 20 Oct 2024 10:43:40 +0800 Subject: [PATCH] update file_upload --- file_upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_upload.py b/file_upload.py index bb275e7..fd471fe 100644 --- a/file_upload.py +++ b/file_upload.py @@ -46,7 +46,7 @@ def upload_file_to_myshell(local_file: str) -> str: start_time = time.time() ext = os.path.splitext(local_file)[1] files = [ - ('file', (os.path.basename(local_file), open(local_file, 'rb'), ext_to_type[ext])), + ('file', (os.path.basename(local_file), open(local_file, 'rb'), ext_to_type[ext.lower()])), ] response = requests.request("POST", server_url, headers=headers, files=files) if response.status_code == 200: @@ -74,7 +74,7 @@ def collect_local_file(item, mapping_dict={}): fpath = None if fpath is not None: ext = os.path.splitext(fpath)[1] - if ext in ext_to_type.keys(): + if ext.lower() in ext_to_type.keys(): mapping_dict[item] = fpath return else: