Hi So I have to send json response from my Flask API including the file, so earlier I was using this for sending the json response
@app.route('/idea123',methods=['POST','GET'])
def func123():
try:
DOWNLOAD_DIRECTORY=r'../../..'
d1={}
result_file = abcd(file)
d1['Status']='Success'
d1['Created_date']=datetime.now()
#return send_from_directory(DOWNLOAD_DIRECTORY, result_file)
return d1
except Exception as e:
print(e)
d1['Status']='Failure'
d1['Created_date']=datetime.now()
return d1
Later I had to send the result file along with json response, how can i send both in same response? I have commented the file that needs to be send code
Mentioned the code above