I am trying to send a request including a rtf file and process it in Flask.
In my python script, I used the striprtf lib to read this file and then process it.
rtf = Path(file_path).read_text()
text = rtf_to_text(rtf)
Now I want to wrap this script into flask. I got error said: TypeError: expected string or bytes-like object. How can I read this rtf file in the flask?
file = request.files['file']
text = rtf_to_text(file)