Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have deployed a FastAPI application in Digitalocen App Platform and I’m trying to upload, write, and modify a file. This is the code I’m using:
@router.post(
"/",
response_model=schemas.GeneralResponseObj,
status_code=status.HTTP_201_CREATED
)
async def load_file(file: UploadFile = File(...), source: str = ''):
"""
Load a file
"""
content = file.file.read()
with open(file.filename, "wb") as f:
f.write(content)
# SOME CODE THAT READS THE FILE
os.remove(file.filename)
return schemas.GeneralResponseObj(
message="Saved new data"
)
It works locally but on the App Platform I receive:
with open(file.filename, "wb") as f:
******* PermissionError: [Errno 13] Permission denied
How can I fix this error? Any help is much appreciated. Thanks
a6309a057c3f4cb38fb2e7feb67236
KFSys
ef1ed44cc2154be3bcbb2d727878f8
Devs Neonetworks
1e6b823ea20d4cb189a34a922f5588
Telmo Valverde
erik-jan martens
Henry Mui
anthonycarreon
garantieheld
Marin