Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`FileUpload`'s `save_file` function returns path incorrectly on Windows with backslash separator (due to `os.path.join`)

Open
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fastapi, python
Domain
api, backend

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastapi-admin/fastapi-admin

All issues in fastapi-admin/fastapi-admin

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.