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 meinheld.set_max_content_length(100*1024*1024) # Return our beautiful Bootstrap webpage. That we totally have. @app.route('/') def upload(): return render_template('upload.html') # What happens when the files just don't fit @app.errorhandler(413) def request_entity_too_large(error): return 'File Too Thicc', 413 # What happens when we did an oopsie @app.errorhandler(500) def internal_server_error(error): return render_template('error.html') # What happens when someone uploads a thingy @app.route('/uploader', 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()