Skip to content

Instantly share code, notes, and snippets.

skwzrd /
Last active August 2, 2020 00:27
Upload a File from React to a Flask API
# the flask post request receiver
from io import BytesIO
from flask import jsonify, request
@app.route('/url_route', methods=['POST'])
def upload_file():
"""Handles the upload of a file."""
d = {}
file = request.files['file_from_react']