3 ms·
Indeed, I've recently had to use Google Drive API v3 and even though it's version 3 there's still a lot to improve. Here's what you need to do to copy a file t
by yread 10y ago
Indeed, I've recently had to use Google Drive API v3 and even though it's version 3 there's still a lot to improve.
Here's what you need to do to copy a file to different folder in C#:
var newFile = drive.Files.Copy(null, fileId).Execute();
var newFileInNewLocationreq = drive.Files.Update(null, newFile.Id);
newFileInNewLocationreq.AddParents = newFolderId;
newFileInNewLocationreq.RemoveParents = oldFolderId;
var newFileInNewLocation = newFileInNewLocationreq.Execute();
To be fair it's just 2 API calls but rather verbose. And that's assuming all the calls work