Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CModule::IncludeModule('tasks');
- $storage = Bitrix\Disk\Driver::getInstance()->getStorageByUserId($USER_ID);
- $folder = $storage->getFolderForUploadedFiles();
- $arFile = CFile::MakeFileArray($FILE_ID);
- $file = $folder->uploadFile($arFile, array(
- 'NAME' => $arFile["name"],
- 'CREATED_BY' => $USER_ID
- ), array(), true);
- $FILE_ID = $file->getId();
- $oTaskItem = new CTaskItem($taskId, $userId);
- $rs = $oTaskItem->Update(array("UF_TASK_WEBDAV_FILES" => Array("n$FILE_ID")));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement