a guest Feb 27th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from flask import Flask, request
- from werkzeug.utils import secure_filename
- import os
- app = Flask(__name__)
- def hello_world():
- return 'Hello, World!'
- FOLDER = 'Recordings/'
- if not os.path.exists(FOLDER):
- @app.route('/file' , methods=['GET' , 'POST'])
- def upload_file():
- if request.method == 'POST':
- f = request.files['DBFile']
- return 'File uploaded successfully'
- except Exception as e:
- print("Exception while running upload_file()" + str(e))
- raise (e)
- if __name__ == '__main__':
- app.run(host="0.0.0.0", port=5000, debug=True)
RAW Paste Data