I'm doing a python script which periodically upload a folder to Google Drive, but got stuck when I had to load subfolders. Is there any way to upload an entire folder?
Maybe with a loop but I have no idea how to do it.
Below is an example of a folder to upload:
root\
root\image.png
root\Folder1\text.txt
root\Folder1\music.mp3
root\Folder2\MyFolder\homeworks.txt
root\Folder2\Something\something.txt
I'm using PyDrive.
A simpler workaround is to just zip the file:
shutil.make_archive('data', 'zip', 'output')
file = drive.CreateFile({'title': 'data.zip'})
file.SetContentFile('data.zip')
file.Upload()