fixing xlsx file bug

This commit is contained in:
dmsanhrProject 2025-11-04 22:48:20 +07:00
parent 52770c1bce
commit a4420a5159

View File

@ -245,9 +245,9 @@ async def upload_file(file: UploadFile = File(...), page: Optional[str] = Form("
print('ext', ext) print('ext', ext)
if ext == ".csv": if ext == ".csv":
df = read_csv(str(tmp_path), sheet)
elif ext == ".xlsx":
df = read_csv(str(tmp_path)) df = read_csv(str(tmp_path))
elif ext == ".xlsx":
df = read_csv(str(tmp_path), sheet)
elif ext == ".pdf": elif ext == ".pdf":
tbl = read_pdf(tmp_path, page) tbl = read_pdf(tmp_path, page)
if len(tbl) == 0: if len(tbl) == 0: