Upload photo to server
Uploads photo to server for further use
- Parameters
- Advanced call ?
Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Image | --file | String, BinaryData | ✔ | Image file |
| Parameters | --auth | Structure Of String | ✖ | Authorization parameters. See GetAuthParameters |
| View | --type | String | ✖ | Upload type (Post, Product, Story, Poll, Other) |
Returns
Map Of KeyAndValue - serialized JSON response from VK
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Parameters = GetVKParameters();
Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Binary data or File path
View = "Post";
Result = OPI_VK.UploadPhotoToServer(Image, Parameters, View);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint vk UploadPhotoToServer \
--file "https://hut.openintegrations.dev/test_data/picture.jpg" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}" \
--type "Post"
:: JSON data can also be passed as a path to a .json file
oint vk UploadPhotoToServer ^
--file "https://hut.openintegrations.dev/test_data/picture.jpg" ^
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}" ^
--type "Post"
Result
{
"response": [
{
"album_id": -14,
"date": 1779802140,
"id": 457250551,
"owner_id": 657846756,
"access_key": "***",
"sizes": [
{
"height": 54,
"type": "s",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 120,
"type": "m",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 480,
"type": "x",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 810,
"type": "y",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 960,
"type": "z",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 1920,
"type": "w",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 81,
"type": "o",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 180,
"type": "p",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 270,
"type": "q",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 405,
"type": "r",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
},
{
"height": 1920,
"type": "base",
"width": "***",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN..."
}
],
"text": "",
"web_view_token": "***",
"has_tags": false,
"orig_photo": {
"height": 1920,
"type": "base",
"url": "https://sun9-38.userapi.com/s/v1/ig2/A0JdYbr6lxHvLdC6DlrNoC3y2qa-W-TIyotYztuH9zRhQEmA1B4gsTImrFiNTdN...",
"width": "***"
}
}
]
}