I
I
IvanovIvanIvanych2020-08-05 13:48:04
Bitrix24
IvanovIvanIvanych, 2020-08-05 13:48:04

Should the disk.file.copyto method return information about the copied file (ID) before the file is copied?

In the PHP handler, the following code:

$url = ' https://**********/disk.file.copyto ';
$arFields = ['id' => $FILE_ID[$i], 'targetFolderId' => $FOLDER_ID];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP/' . phpversion());
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arFields));
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);
$result = json_decode($response, true);

$result should return information about the copied file (including its ID). Please tell me, if a large file is copied within a few seconds - the answer in $result containing the ID of the copied file should come before the copy operation is completed, or only after the file is copied?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question