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.a0AeXRPp7yIYtWir0wC7l09O27fzCyaFxBylix9NPJ_QNA1wB4QVUrG4U7Fr2QSwtfnWG7ZYf6VNrnekZ-jXtryEWp_DVIDnn_y8ABtqeWr...";
NewName = "UpdatedFile.jpg";
Identifier = "1Zw1gcXzKA8iyhPpSv8Sg0wcqss9cJR2i";
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 "***" \
--object "1adjYm5qWMjPSu0yy9rMMrlk7vqCTs43L" \
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
Result
{
"kind": "drive#file",
"id": "1slRtvK9Yap08a-wh_iE5go6dkCMwZrYH",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}