Skip to content

Commit

Permalink
Replaced naming filename for FileSystemStorage (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannal authored Apr 26, 2024
1 parent 4a3aa6b commit 0ff4218
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fastapi_storages/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ def open(self, name: str) -> BinaryIO:
Open a file handle of the file object in binary mode.
"""

path = self._path / Path(name)
path = self.get_path(name)
return open(path, "rb")

def write(self, file: BinaryIO, name: str) -> str:
"""
Write input file which is opened in binary mode to destination.
"""

filename = secure_filename(name)
path = self._path / Path(filename)
filename = self.get_name(name)
path = self.get_path(filename)

file.seek(0, 0)
with open(path, "wb") as output:
Expand Down

0 comments on commit 0ff4218

Please sign in to comment.