After python script uploads the file, the file’s content is erased

I have created a small web app using Flask and Docker. Unfortunately, when I upload the file into the container using my python script, the file saves as a an empty file with the appropriate name. There are no specifics to understand this problem because it was not expected.

Source: Docker Questions