Documentation

task.item.addfile

Attention! This method is deprecated and is no longer supported. It is recommended to use the methods tasks.task.*.

This method loads file for a task. Presently file loading is realized via post with the transfer of the file in the CONTENT parameter.

Method parameters

ParameterDescription
TASK_IDTask ID.
NAMEFile name.
CONTENTFile content in base64.

Example

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://test-domain.com/rest/task.item.addfile.xml');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, array( 
    'auth' => 'z3eamwwkpgl7u18kx14q1s4c0ffckqsn', 
    'TASK_ID' => "140", 
    'FILE[NAME]' => 'desc.txt', 
    'FILE[CONTENT]' => base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] .'/desc.txt')) 
));
$out = curl_exec($curl);
print($out);
curl_close($curl);

© «Bitrix24», 2001-2024