uploaded images saved to Pi

This commit is contained in:
Neythen
2021-10-07 20:40:43 +01:00
parent 3fb1ee197a
commit acd46c0aef
10 changed files with 66 additions and 6 deletions

View File

@@ -367,6 +367,28 @@ def feature_settings():
return index()
# saves files uploaded to the webpage for images and GIFs
@app.route("/upload", methods = ['PUT', 'POST', 'GET'])
def upload():
try:
images = request.files
names = list(request.files.keys())
for name in names:
images[name].save('user_uploads/' +name)
except Exception as e:
print(e)
return index()
def combine_dict(current_settings, input_symbols, current_key):
# removes keys not in input from current_settings[current_key] and adds keys not in current from input