I want to store any uploaded image to the static/customlogos folder with the name "logo.png" no matter what its actual name is. I have a basic Flask setup with the typical static and template folders. For simplicity I removed things like extension validation in my code below. However doing it like this throws a FileNotFound error. Since I want to run my app on various environments, I don't want to use a static path. What am I doing wrong? Thanks for your help.
latestfile = request.files['customlogo']
#This prints the file name of the uploaded file
print(latestfile.filename)
#I want to save the uploaded file as logo.png. No matter what the uploaded file name was.
latestfile.save(os.path.join('/static/customlogos', 'logo.png'))