Spaces:
Sleeping
Sleeping
Download app/util/file_util.py from smartjaac/backoffice: direct link, hf CLI and curl.
- Browser
- Download file 236 Bytes
-
https://huggingface.co/spaces/smartjaac/backoffice/resolve/main/app/util/file_util.py
- Command line
-
hf download hf://spaces/smartjaac/backoffice/app/util/file_util.py
-
curl -L -o file_util.py https://huggingface.co/spaces/smartjaac/backoffice/resolve/main/app/util/file_util.py
236 Bytes
| import shutil | |
| from fastapi import UploadFile | |
| def write_file_env(path: str, file: UploadFile): | |
| # if os.path.isfile(env_path): | |
| # os.remove(env_path) | |
| with open(path, 'w+b') as f: | |
| shutil.copyfileobj(file.file, f) | |