Skip to main content

Update file

Updates file binary data

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

ParameterCLI optionTypeDescription
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


Code example
  
NewName = "Updated file.jpeg";
ReplacementImage = "C:\OPI\image2.jpg";
Identifier = "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ";

Response = OPI_GoogleDrive.UpdateFile(Token, Identifier, ReplacementImage, NewName) //Map
Response = OPI_Tools.JSONString(Response); //String
CLI command example
    
oint gdrive UpdateFile --token %token% --object "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ" --file %file% --title %title%

Result
{
"mimeType": "image/jpeg",
"name": "UpdatedFile.jpg",
"id": "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ",
"kind": "drive#file"
}