Skip to content

Instantly share code, notes, and snippets.

@Padilo300
Created September 28, 2020 10:37
Show Gist options
  • Save Padilo300/f0c5a152275c6c2904367f669b136c2d to your computer and use it in GitHub Desktop.
Save Padilo300/f0c5a152275c6c2904367f669b136c2d to your computer and use it in GitHub Desktop.
Bitrix Bx file product add fileData
$img = file_get_contents('https://3dwarehouse.sketchup.com/warehouse/v1.0/publiccontent/3b855d94-6ed8-4f88-a69c-d9a4fcfc052f');
$res = CRest::call('crm.product.add',[
'fields' => [
"NAME" => "1С-Битрикс: Управление сайтом - Старт",
'PREVIEW_PICTURE' => [
"fileData" => ['file.png', base64_encode($img)]
]
]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment