I want to time how long it takes to upload a file to a Flask app. I am trying to use something like this to know when the upload starts:
@app.before_request
def before_request():
g.start = time.time()
However, before_request
fires only after the full request (file) has been uploaded, so at most, all I can measure how long it takes to process the uploaded file.
Is there another signal/decorator I can use to determine when a Request has been initiated, even before the full request is available? (ie when a user starts to upload a file, but before it begins?)