mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-10 16:22:38 +02:00
fix: strip folder prefix from filename in folder upload
This commit is contained in:
parent
89f210bf7e
commit
e7107b751d
1 changed files with 2 additions and 1 deletions
|
|
@ -1565,7 +1565,8 @@ async def folder_upload(
|
||||||
|
|
||||||
async def _read_and_save(file: UploadFile, idx: int) -> dict:
|
async def _read_and_save(file: UploadFile, idx: int) -> dict:
|
||||||
content = await file.read()
|
content = await file.read()
|
||||||
filename = file.filename or rel_paths[idx].split("/")[-1]
|
raw_name = file.filename or rel_paths[idx]
|
||||||
|
filename = raw_name.split("/")[-1]
|
||||||
|
|
||||||
def _write_temp() -> str:
|
def _write_temp() -> str:
|
||||||
with tempfile.NamedTemporaryFile(
|
with tempfile.NamedTemporaryFile(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue