0
f = drive.CreateFile({"parents": [{"kind": "linktodrive", "id": fid}]})
f.SetContentFile('traffic_measurement'+str(y)+'.csv')

f1 = drive.CreateFile({"parents": [{"kind": "linktodrive", "id": fid}]})
f1.SetContentFile('speed_violation'+str(y)+'.csv')

f2 = drive.CreateFile({"parents": [{"kind": "linktodrive", "id": fid}]})
f2.SetContentFile('detected_vehicles'+str(y))

f3 = drive.CreateFile({"parents": [{"kind": "linktodrive", "id": fid}]})
f3.SetContentFile('speed_violation'+str(y))

f.Upload()
f1.Upload()
f2.Upload()
f3.Upload()

The file are successfully uploaded and I then to tried to upload folder which shows the following error.

self.content = open(filename, 'rb')
PermissionError: [Errno 13] Permission denied: 'detected_vehicles2019-10-18
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • Are you trying to upload all files in a certain folder? You can't open a folder like you open a file. – xhenrique Oct 18 '19 at 10:22
  • Yes, you can say that I am trying to upload all the files in that folder but to keep it organized I want folder to be uploaded. – amicableGalaxy Oct 18 '19 at 11:07
  • I think you should create one zip file with the content you want to upload and them upload it. Other option is to use something like ```glob``` to iterate over your files and upload them one by one. As i said before, it's not possible to open a folder like you open a file. – xhenrique Oct 21 '19 at 11:59
  • Thanks for the answer, I think you it will solve my problem. – amicableGalaxy Oct 22 '19 at 04:43

0 Answers0