Documentation

lists.element.get.file.url

lists.element.get.file.url (
   params
)

This method returns path to a file. If successful, returns an array with a list of url for the required File-type or a File (Disk)-type field.

Parameters

Method Description Available from version
params All fields are required.
  • IBLOCK_TYPE_ID - ID of information block type:
    • lists - information block type for lists;
    • bitrix_processes - information block type for processes;
    • lists_socnet - information block type for group lists. In this case, parameter SOCNET_GROUP_ID - group ID must be passed.
  • IBLOCK_ID - information block ID
  • ELEMENT_ID - element ID
  • FIELD_ID - ID for the field (information block properties) of File or FIle (Disk) type, without "PROPERTY_" prefix
  • SEF_FOLDER: '/my_section/lists/' - path to folder to be handled by component. Optional parameter. By default, value is selected depending on one of the information block system types.
SOCNET_GROUP_IDgroup ID (required, if list is created for group);

Example

var params = {
    'IBLOCK_TYPE_ID': 'lists',
    'IBLOCK_ID': '41',
   'ELEMENT_ID': '683',
   'FIELD_ID': '120'
};
BX.rest.callMethod(
   'lists.element.get.file.url',
   params,
   function(result)
   {
       if(result.error())
           alert("Error: " + result.error());
       else
           console.log(result.data());
   }
)
© «Bitrix24», 2001-2024