Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/googleapiclient/http.py", line 578, in _del_
self._fd.close()
AttributeError: 'MediaFileUpload' object has no attribute '_fd'
I got the same error while executing MediaFileUpload() but It's fine to work in the windows machine. Anyone here can please help me. Thanks
my code is:
try:
file_metadata = {'name': filename, 'parents': [folder_id]}
media = MediaFileUpload(filepath,
mimetype=mimetype,resumable=True)
file = drive_service.files().create(body=file_metadata,
media_body=media).execute()
print('Uploaded File ID: %s' % file.get('id'))
except Exception as e:
print(e)