D
D
dev4002016-10-07 21:04:44
PHP
dev400, 2016-10-07 21:04:44

How to upload a file in Bitrix 24 via API?

How to upload a file to a custom field of type "file" via api? Does anyone have a php code example?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-10-07
@dev400

The REST service methods receive files as a base64 encoded string. You can also send a regular array, the first element of which will be the file name, the second - the content in base64.

dev.1c-bitrix.ru/rest_help/js_library/rest/files.php
POST https://my.bitrix24.com/rest/entity.item.add.json HTTP/1.1
Host: my.bitrix24.com
Content-Length: 186
Content-Type: text/plain; charset=UTF-8

auth=xxx&ENTITY=menu&NAME=yyy&DETAIL_PICTURE[0]=1.gif&DETAIL_PICTURE[1]=R0lGODlhAQABAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question