Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route("/upload", methods=['POST'])
- async def omo(request):
- from sanic import response
- import os
- if not os.path.exists(appConfig["upload"]):
- os.makedirs(appConfig["upload"])
- f = open(appConfig["upload"]+"/"+request.files["file"][0].name,"wb")
- f.write(request.files["file"][0].body)
- f.close()
- return response.json(True)
Add Comment
Please, Sign In to add comment