`FileUpload`'s `save_file` function returns path incorrectly on Windows with backslash separator (due to `os.path.join`)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start by locating FileUpload.save_file from the fastapi_admin.file_upload import path and inspect how it combines the prefix and filename. Reproduce the returned path on Windows, then verify that the fetch URL uses URL-style separators rather than an OS-dependent backslash.
Written by the indexing model from the issue text.
Description
Title says it all.
When using from fastapi_admin.file_upload import FileUpload and it returns the save path (endpoint to fetch the file) using prefix and filename, it joins the path using os.path.join, which is OS-dependent. This causes the filename to contain \ separated path on Windows.
Example:
upload_face = FileUpload(
uploads_dir="./static/uploads",
prefix="/faces", # StaticFiles is mounted here
filename_generator=random_filename, # Ignore this
)
It just causes the backslash escape character sequence to mess up path when fetching images sometimes.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 466
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fastapi-admin/fastapi-admin
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
fastapi-admin/fastapi-admin#187 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
fastapi-admin/fastapi-admin#197 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
fastapi-admin/fastapi-admin#196 ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
fastapi-admin/fastapi-admin#194 · 2 comments ·
-
支持代理站吗 Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
fastapi-admin/fastapi-admin#193 ·
All issues in fastapi-admin/fastapi-admin
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·