FastAPI - File Handling
Find the bug in this FastAPI file saving code:
from fastapi import FastAPI, File, UploadFile
app = FastAPI()
@app.post('/upload')
async def upload(file: UploadFile = File(...)):
with open(file.filename, 'wb') as f:
content = await file.read()
f.write(content)
return {'filename': file.filename}