1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-29 21:57:16 +02:00
Vitaly the Alpaca (bot) bf7a7febc2 Main build (Jenkins)
2024-09-29 12:34:39 +03:00

1.3 KiB

sidebar_position
4

Upload file

Uploads a file to the drive

Function UploadFile(Val Token, Val File, Val Description) Export

Parameter CLI option Type Description
Token --token String Token
File --file BinaryData,String File to be uploaded
Description --props Map Of KeyAndValue JSON description or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from Google


    Token     = "ya29.a0AcM612wLdbBK14FR2SE0d3WHabYb8Xtppm0oKCcbVrecgsA-a5DfsgZ29stOw4hu84F_IpHbKTJocsm1WpjLQPBT5MJ6p8D7H1PKa_iT0...";
    Image     = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg";
    Directory = "191iyaa6-2BCNRPOF0F8mQ0TuNWPNesdM";

    Description = OPI_GoogleDrive.GetFileDescription();
    Description.Insert("Parent", Directory);

    Result = OPI_GoogleDrive.UploadFile(Token, Image, Description);
    
  oint gdrive UploadFile --token %token% --file %file% --props %props%

{
  "mimeType": "image/jpeg",
  "name": "New file.jpg",
  "id": "16hPGNTMmbnXhz_g0vjGbrLP19h56RwIg",
  "kind": "drive#file"
  }