Skip to content

Instantly share code, notes, and snippets.

@WingCH
Last active June 23, 2019 09:00
Show Gist options
  • Save WingCH/f7c7bb394b47309ed691d2b480ca610f to your computer and use it in GitHub Desktop.
Save WingCH/f7c7bb394b47309ed691d2b480ca610f to your computer and use it in GitHub Desktop.
Python ajax upload file to python server(bottle)
from bottle import Bottle, run, template, request, static_file
import os
import json
app = Bottle()
@app.route('/uploadTest', method='POST') #upload page
def uploadTest():
filename = request.files.get('file').raw_filename
return filename
run(app, host='localhost', port=8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment