PetscGoogleDriveUpload#
Loads a file to the Google Drive
Synopsis#
PetscErrorCode PetscGoogleDriveUpload(MPI_Comm comm, const char access_token[], const char filename[])
Not Collective, only the first process in the MPI_Comm
uploads the file
Input Parameters#
comm - MPI communicator
access_token - obtained with PetscGoogleDriveRefresh(), pass
NULL
to have PETSc generate onefilename - file to upload; if you upload multiple times it will have different names each time on Google Drive
Options Database Key#
-google_refresh_token XXX - pass the access token for the operation
Usage Patterns#
With PETSc option -google_refresh_token XXX given
PetscGoogleDriveUpload(comm,NULL,filename); will upload file with no user interaction
Without PETSc option -google_refresh_token XXX given
PetscGoogleDriveUpload(comm,NULL,filename); for first use will prompt user to authorize access to Google Drive with their browser
With PETSc option -google_refresh_token XXX given
PetscGoogleDriveRefresh(comm,NULL,access_token,sizeof(access_token));
PetscGoogleDriveUpload(comm,access_token,filename);
With refresh token entered in some way by the user
PetscGoogleDriveRefresh(comm,refresh_token,access_token,sizeof(access_token));
PetscGoogleDriveUpload(comm,access_token,filename);
PetscGoogleDriveAuthorize(comm,access_token,refresh_token,sizeof(access_token));
PetscGoogleDriveUpload(comm,access_token,filename);
See Also#
PetscURLShorten()
, PetscGoogleDriveAuthorize()
, PetscGoogleDriveRefresh()
Level#
intermediate
Location#
Examples#
src/sys/webclient/tutorials/googledriveupload.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages