Skip to content

Commit

Permalink
Loading and Saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurmitha4004 committed Aug 2, 2024
1 parent 2b33219 commit e192942
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public async Task<IActionResult> EditDocument()
public async Task<MemoryStream> GetDocumentFromGoogleDrive()
{
//Define the path to the service account key file
string pathtoserviceaccountkey = "Your_service_account_key_path";
string serviceAccountKeyPath = "Your_service_account_key_path";

//Specify the FileID of the file to download
string fileID = "Your_file_id";

try
{
//Authenticate the Google Drive API access using the service account key
GoogleCredential credential = GoogleCredential.FromFile(pathtoserviceaccountkey).CreateScoped(DriveService.ScopeConstants.Drive);
GoogleCredential credential = GoogleCredential.FromFile(serviceAccountKeyPath).CreateScoped(DriveService.ScopeConstants.Drive);

//Create the Google Drive service
DriveService service = new DriveService(new BaseClientService.Initializer()
Expand Down

0 comments on commit e192942

Please sign in to comment.