forked from ellcontreras/lap_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
22 lines (16 loc) · 613 Bytes
/
Copy pathmain.py
File metadata and controls
22 lines (16 loc) · 613 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from flask import Flask, render_template, url_for, request
from werkzeug.utils import secure_filename
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/send-file', methods=['POST', 'GET'])
def send_file():
if request.method == 'POST':
for file in request.files.getlist('file[]'):
file.save('./files/' + secure_filename(file.filename))
return 'The upload has finished successfully!'
elif request.method == 'GET':
return render_template('send-file.html')
if __name__ == "__main__":
app.run(host='0.0.0.0')