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()