Tobiq
Tobiq

Reputation: 2657

Can you upload changes, to Google Drive, only?

Similarly to GIT, is it possible to upload changes to a file, only, instead of uploading the entire new file?

I wish to do this within C#.

I've tried searching for a solution, but haven't had luck.

Upvotes: 1

Views: 162

Answers (2)

S.Marchet
S.Marchet

Reputation: 1

Yes, you can!!! This example I'm using for spreadsheets:

string fileID = "CHANGE_TO_FILE_ID";

var stream = new System.IO.FileStream(openFile.FileName, System.IO.FileMode.Open)

var driveFile = new Google.Apis.Drive.v3.Data.File();

FilesResource.UpdateMediaUpload requestUpdate;

requestUpdate = service.Files.Update(driveFile, fileID, stream, GetMimeType(openFile.FileName));

requestUpdate.Fields = "id";

requestUpdate.Upload();

var retornoUpdate = requestUpdate.ResponseBody;
Console.WriteLine("FILE: " + retornoUpdate.Id);

Upvotes: 0

pinoyyid
pinoyyid

Reputation: 22306

No you can't. The only exception is if it's a spreadsheet you can update individual cells using the Sheets API.

Upvotes: 1

Related Questions