careposa.blogg.se

Python google drive api upload file
Python google drive api upload file













python google drive api upload file

Payload = media_upload.getbytes(0, media_upload.size())įile "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 482, in getbytes I am able to upload the small files but when I am trying with 8GB of the file, it is giving MemorryErro.Please find the error message that I am getting.įile "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 853, in method Print('Uploaded "%s" (%s)' % (filename, res)) Res = DRIVE.files().create(body=metadata, media_body=filename).execute() ('/home/vkm/mayur/Demo_Google_API.zip', 'application/'), Http = thorize(httplib2.Http())ĭRIVE = discovery.build('drive', 'v3', http=http) I am trying to upload files to Google drive by Google API using the following codeįrom oauth2client import file, client, toolsįlags = argparse.ArgumentParser(parents=).parse_args()įlow = client.flow_from_clientsecrets('client_secret.json', SCOPES)Ĭreds = n_flow(flow, store, flags) if flags else n(flow, store)ĭRIVE = discovery.build('drive', 'v3', http=thorize(Http()))















Python google drive api upload file