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) cac41ea00b Main build (Jenkins)
2024-10-12 18:42:55 +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.a0AcM612yqBU-Js-ZwvMX9kOgTqr1bzVlotSXxpjuDiy-VQFNrbVcJqWC-p_l2W_Ng_se_7j6PbCOWHu1waCLQEAilKYg3xb2Q18DG_cMfA...";
    NewName    = "UpdatedFile.jpg";
    Identifier = "1U8hhtaSXcxZuojGLumLYODMBspUV501s";
    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"
}