uploaded images saved to Pi
This commit is contained in:
22
server.py
22
server.py
@@ -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
|
||||
|
Reference in New Issue
Block a user