Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. from flask import Flask, request, jsonify
  2. import flask_excel as excel
  3.  
  4. app=Flask(__name__)
  5.  
  6. @app.route("/upload", methods=['GET', 'POST'])
  7. def upload_file():
  8. if request.method == 'POST':
  9. return jsonify({"result": request.get_array(field_name='file')})
  10. return '''
  11. <!doctype html>
  12. <title>Upload an excel file</title>
  13. <h1>Excel file upload (csv, tsv, csvz, tsvz only)</h1>
  14. <form action="" method=post enctype=multipart/form-data><p>
  15. <input type=file name=file><input type=submit value=Upload>
  16. </form>
  17. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement