I would like to upload generic binary files (to be specific .root files, output of ROOT by CERN) to Google Drive using Python 3.6 and Google Drive API v3. If I try my usual code:
FILES = ((filename, None) for filename in filelist)
for filename, mimeType in FILES:
metadata = {'name': filename}
if mimeType:
metadata['mimeType'] = mimeType
res = DRIVE.files().create(
body = metadata, media_body = filename).execute()
I get the following error:
raise UnknownFileType(media_filename)
googleapiclient.errors.UnknownFileType
I guess it depends from the fact that root files are unknown to GDrive. Is there any way to upload them nonetheless (or any other "custom" binary file, if that matters)?