From d8a40ecec779170518b3c184f9a7c88b884c3eb5 Mon Sep 17 00:00:00 2001 From: fumiya-kubota Date: Wed, 25 Jan 2017 13:36:47 +0900 Subject: [PATCH] =?UTF-8?q?zip=E3=81=AE=E6=A7=8B=E9=80=A0=E3=81=AB?= =?UTF-8?q?=E3=82=88=E3=81=A3=E3=81=A6upload=E3=81=AB=E5=A4=B1=E6=95=97?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db_models/datasets.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/db_models/datasets.py b/src/db_models/datasets.py index 026cba8..e46da9b 100644 --- a/src/db_models/datasets.py +++ b/src/db_models/datasets.py @@ -194,10 +194,9 @@ def save_uploaded_data(self, uploaded_file, save_raw_file_to, save_to): if ('__MACOSX' in file_name) or ('.DS_Store' in file_name): continue temp_path = os.path.join(extract_to, file_name) - if not os.path.basename(file_name): - if not os.path.exists(temp_path): - os.makedirs(temp_path.encode(encoding='utf-8')) - category_num += 1 + if not os.path.exists(os.path.dirname(temp_path)): + os.makedirs(temp_path.encode(encoding='utf-8')) + category_num += 1 else: temp, ext = os.path.splitext(temp_path) ext = ext.lower()