Skip to main content

Update file

Updates file binary data

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

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Identifier--objectStringIdentifier of the object to update
File--fileBinaryData,StringFile source for update
NewName--titleStringNew file name (if necessary)

Returns: Map Of KeyAndValue - serialized JSON response from Google


tip

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    Token      = "ya29.a0AQQ_BDTgQbn9c5rXhPK3FCakms_7oKkdIWE1CCQFnSPftb2RxvloVqnYOcnsAKhXrD0Gq8Tz2Kgn5IBXG5E25uksZfvvTtXob-jFcuj_9LZYs9La4HrcFk766...";
NewName = "UpdatedFile.jpg";
Identifier = "1lZ0YvekgaZiJuZay2g2BiCAkRVrCjmNW";
File = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary Data or File path

Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
    oint gdrive UpdateFile \
--token "***" \
--object "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei" \
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
Result
{
"kind": "drive#file",
"id": "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}