Skip to content

Instantly share code, notes, and snippets.

@omeroot
Created October 24, 2015 10:58
Show Gist options
  • Save omeroot/080166a5f6b9af1d6237 to your computer and use it in GitHub Desktop.
Save omeroot/080166a5f6b9af1d6237 to your computer and use it in GitHub Desktop.
from flask import Flask
from flask import request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'hello world'
@app.route('/upload',methods=['POST'])
def upload():
f = request.files['the_files']
f.save('/tmp/' + secure_filename(f.filename))
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment