I have the following code to upload an CSV file using Python FLASK.
from flask_restful import Resource
import pandas as pd
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
class UploadCSV(Resource):
def post(self):
files = request.files['file']
files.save(os.path.join(ROOT_PATH,files.filename))
data = pd.read_csv(os.path.join(ROOT_PATH,files.filename))
print(data)
api.add_resource(UploadCSV, '/v1/upload')
if __name__ == '__main__':
app.run(host='localhost', debug=True, port=5000)
This code works fine and I can able to upload CSV file successfully and read it using pandas dataframe. But I'm saving the csv in local filesystem and reading it.
I have tried reading like below -
files = request.files[&#