landing.block.uploadfile
landing.block.uploadfile(block, picture)
The method downloads image and binds it to a specified block. On success, returns a pair: direct path to downloaded file and the saved file ID. Form this moment, the image will be deleted only when a block, landing page (that includes the block) are fully deleted or via calling the method landing.landing.removeEntities.
Parameters
Parameter | Description | Available from version |
---|---|---|
block | Block ID | |
picture | Variants:
|
Example
BX24.callMethod( 'landing.block.uploadfile', { block: 12294, picture: 'https://site.com/******.jpg' // picture: document.getElementById('file') }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
© «Bitrix24», 2001-2024