php or python script to upload mp4 video and get link

  onedrive, php, python, rest

hello I need any help regarding this problem, I have done the research and i found it confusing.
I need to upload a file in the backend in PHP or python whichever is possible this will be automated
the idea is that I send 2 parameters 1-subfolder name and 2-the actual file and in return, I get the file link after upload.
so also all the work needs to be done in the folder if a subfolder with a given name does not exist then create it and insert the given file there and return the link
any help is much appreciated

Source: Ask PHP