I'm trying to upload xls in my application and then processing it in backend i.e.python flask, the below code works in ubuntu 14.04 but fails in Heroku with Attribute Error 'Request' object has no attribute 'get_array'
Code as below
import flask_excel as excel
try:
if request.method == 'POST':
file_obj = request.get_array(field_name='file')
Error in heroku is for the request.get_array
'Request' object has no attribute 'get_array
'
My requirements.txt in heroku has the below
Flask-Excel==0.0.7
pyexcel-xls==0.5.7
My HTML code is below
<form action="/upload_contacts" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<button type="submit" class="btn btn-primary">Add Contacts</button>
</form>
I am referring this http://flask-excel.readthedocs.io/en/latest/ link for uploading .xls/.xlsx file.
I did try searching for a fix, in github someone mentioned I have to use from flask.ext import excel but this seems deprecated now and replaced by flask_excel.
Please suggest how to fix this issue.
Thanks