Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, request, jsonify
- import flask_excel as excel
- app=Flask(__name__)
- @app.route("/upload", methods=['GET', 'POST'])
- def upload_file():
- if request.method == 'POST':
- return jsonify({"result": request.get_array(field_name='file')})
- return '''
- <!doctype html>
- <title>Upload an excel file</title>
- <h1>Excel file upload (csv, tsv, csvz, tsvz only)</h1>
- <form action="" method=post enctype=multipart/form-data><p>
- <input type=file name=file><input type=submit value=Upload>
- </form>
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement