36 lines
786 B
Python
36 lines
786 B
Python
from flask import Flask, render_template, request
|
|
from datetime import datetime
|
|
import re
|
|
import fnmatch
|
|
import os
|
|
import meinheld
|
|
|
|
app = Flask(__name__)
|
|
|
|
app.config['UPLOAD_FOLDER'] = "./dataset/"
|
|
|
|
app.config['MAX_CONTENT_LENGTH'] = 10000000000 # 10GB
|
|
|
|
# Return our beautiful Bootstrap webpage. That we totally have.
|
|
@app.route('/')
|
|
def upload():
|
|
return render_template('index.html')
|
|
|
|
# What happens when someone uploads a thingy
|
|
@app.route('/upload', methods=['POST'])
|
|
def upload_file():
|
|
if request.method == 'POST':
|
|
f = request.files['file']
|
|
|
|
|
|
|
|
|
|
# Return success webpage
|
|
return render_template('successful.html')
|
|
else:
|
|
# No POST Found
|
|
return render_template('error.html')
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|