save csv file in postgres database using flask save csv file in postgres database using flask flask flask

save csv file in postgres database using flask


<form><input onChange={this.fileHandler} type="file" accept=".csv,text/csv" name = "file" /></form>

Since you are doing,

csv_file = request.files['file']

Here the string 'file' is the key, where the value is the actual file uploaded. The key is the name specified in the input tag in HTML


I think you forget to add the attribute on the form:enctype="multipart/form-data"