1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Google_Drive/File-and-directory-management/Update-file.md
T
Vitaly the Alpaca (bot) 6baf87b203 Main build (Jenkins)
2024-10-13 01:45:32 +03:00

1.3 KiB

sidebar_position
sidebar_position
8

Update file

Updates file binary data

Function UpdateFile(Val Token, Val Identifier, Val File, Val NewName = "") Export

Parameter CLI option Type Description
Token --token String Token
Identifier --object String Identifier of the object to update
File --file BinaryData,String File source for update
NewName --title String New file name (if necessary)

Returns: Map Of KeyAndValue - serialized JSON response from Google


    Token      = "ya29.a0AcM612w6SWzMf3Ti1dSiFdgdLdXxLBjzKdXoLGuGDHoSXzb0uAKe5hJ-HPz1Njyp7HuHE6NnMnevQwbo0AR-yPAwfrA1OsMFZ_Fac2ASn...";
    NewName    = "UpdatedFile.jpg";
    Identifier = "1rjQ1PytDjJVgTIkNK600sQEPGqHDIeWW";
    File       = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary Data or Path to file

    Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
    
  oint gdrive UpdateFile --token %token% --object "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ" --file %file% --title %title%

{
 "kind": "drive#file",
 "id": "1slRtvK9Yap08a-wh_iE5go6dkCMwZrYH",
 "name": "UpdatedFile.jpg",
 "mimeType": "image/jpeg"
}