Express.js backend is getting an uploaded file from client and it should pass this file to Flask service. I am able to get uploaded file as JSON in Express backend and then I can pass it to Flask service. After that I like to upload it using request.files
, but this object returns empty. Then I tried to get json data using request.get_json(force=True)
I can get the JSON file that is like below
{
'name':'filename.pdf',
'data':Buffer
'size':328727,
'encoding':'7bit',
'tempFilePath':'',
'truncated':False
'mimetype':'application/pdf'
'md5':'d199d18721a2118114e994a76f0c90c9'
}
Since request.files
is empty, I like to use request.get_json(force=True)
JSON object to upload file. My question is how can I use this JSON object in order to upload file?