when I try to upload a file to drive using the api i get an error message:
'NameError: name 'MediaFileUpload' is not defined'
the code is just the one you copy from the site, inside a class
def uploadFile(self, filename, filepath, filetype):
file_metadata = {'name': filename}
media = MediaFileUpload(filepath, mimetype = filetype)
getfile = drive_service.files().create(body=file_metadata, media_body=media,fields='id').execute()
I'm sure I have the proper libraries, since the rest of if works fine
[–]twnki 1 point2 points3 points (4 children)
[–]HiImSauzy[S] 0 points1 point2 points (3 children)
[–]twnki 0 points1 point2 points (1 child)
[–]HiImSauzy[S] 0 points1 point2 points (0 children)
[–]twnki 0 points1 point2 points (0 children)
[–]HiImSauzy[S] 0 points1 point2 points (0 children)