fix: Create dir on upload
This commit is contained in:
parent
e322b8bbe7
commit
084a161e80
6
main.py
6
main.py
@ -120,10 +120,8 @@ def upload_site(name):
|
|||||||
return "Error: No file provided."
|
return "Error: No file provided."
|
||||||
|
|
||||||
if file:
|
if file:
|
||||||
if not os.path.exists('uploads'):
|
if not os.path.isdir('/var/www/{id}'.format(id=site['id'])):
|
||||||
os.makedirs('uploads')
|
os.mkdir('/var/www/{id}'.format(id=site['id']))
|
||||||
if not os.path.exists('uploads/' + name):
|
|
||||||
os.makedirs('uploads/' + name)
|
|
||||||
|
|
||||||
|
|
||||||
filename = file.filename
|
filename = file.filename
|
||||||
|
Loading…
Reference in New Issue
Block a user