I need to override an existing file inside a google drive folder with a new file. This is what I have.
file = drive.CreateFile({'id': <id_of_file_which_I_wish_to_overwrite>})
file.SetContentFile(<my_file_path>)
file.Upload()
print('title: %s, mimeType: %s' % (file5['title'], file5['mimeType']))
I keep getting an error from file.Upload() line such as this:
RedirectMissingLocation: Redirected but the response is missing a Location: header.
Any ideas of what's causing this? What this Location is or the header? I noticed that I am not getting this error when I run the same code without file.SetContentFile and instead only change file metadata instead of overwriting it.