Documentation

GetFileList

CPosting::GetFileList(
    int ID,
    int file_id = false
);

The method GetFileList returns the issue attachments.

Parameters

ParameterDescription
ID The issue ID.
file_id The attachment ID. If omitted or false, all attachments are returned.

Return Values

Returns the CDBResult query result. The following File fields become available after the result is fetched: ID, FILE_SIZE, ORIGINAL_NAME, SUBDIR, FILE_NAME, CONTENT_TYPE.

Example



// size of all attachments
$attach_size = 0;
$rsFile = CPosting::GetFileList($ID);
while($arFile = $rsFile->Fetch())
    $attach_size += $arFile["FILE_SIZE"];
© «Bitrix24», 2001-2024