I hit one question below, could you please help to give some suggestions? Appreciate.

I want to get duration(length) of a videofile upload by user, then update this “duration” into database after file uploaded. --- I already have my own algo which can calculate the duration(length) of a videoFile. What I stuck is I need to run this algo immediately after file saved on the server.

I find "post\_save", but it looks this execute before the file upload(before this file exist in this server path, so if I use "post\_save", I will hit the error that this file is not exist).

VUE + Django + DjangoRestFramework

Here is my step:

1.Create Voice Model include Field: videoFile(FileField) and the duration of this video(FloatField)
(**Because I need to get this file at the server path, so before this file exist, I set default value for example 0 to Duration column; after file uploaded, then I calculate, and update**)

2.After user upload this file into server, I will run my algorithm in the file path and calculate this duration of this file(input: filepath and this filename; output: duration)

3.After get this duration of this file, I need to update this database immediately

So my question is, how to execute my algo immediately after this file already uploaded into server? And then update database.