normalize uploaded filename extension to lowercase for consistent downstream checks
This commit is contained in:
parent
a08b73e385
commit
4c5ded4c52
1 changed files with 3 additions and 1 deletions
|
|
@ -296,7 +296,9 @@ def upload_dataset(
|
|||
raise HTTPException(status_code=400, detail="Empty upload payload")
|
||||
|
||||
DATASET_UPLOAD_DIR.mkdir(parents=True, exist_ok=True)
|
||||
stored_name = f"{uuid4().hex}_{filename}"
|
||||
# Normalize extension to lowercase so downstream suffix checks work
|
||||
stem = Path(filename).stem
|
||||
stored_name = f"{uuid4().hex}_{stem}{ext}"
|
||||
stored_path = DATASET_UPLOAD_DIR / stored_name
|
||||
stored_path.write_bytes(file_bytes)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue