src/MediaServices/MediaServicesRestProxy.php
public function downloadAssetFile(AssetFile $assetFile, Locator $locator, $path)
    {
        Validate::isString($path, 'path');
        Validate::pathExists($path);

        $downloadUrl = $locator->getBaseUri().'/'.$assetFile->getName().$locator->getContentAccessComponent();
        $filePath = $path.'/'.$assetFile->getName();

        return file_put_contents($filePath, fopen($downloadUrl, 'r'));
    }
public function downloadAssetFile(AssetFile $assetFile, Locator $locator, $path)
    {
        Validate::isString($path, 'path');
        Validate::pathExists($path);

        $downloadUrl = $locator->getBaseUri().'/'.$assetFile->getName().$locator->getContentAccessComponent();
        $filePath = $path.'/'.$assetFile->getName();

        return file_put_contents($filePath, fopen($downloadUrl, 'r'));
    }
public function downloadAssetFile ( AssetFile $ assetFile , Locator $ locator , $ path ) { Validate :: isString ( $ path , 'path' ) ; Validate :: pathExists ( $ path ) ; $ downloadUrl = $ locator -> getBaseUri ( ) . '/' . $ assetFile -> getName ( ) . $ locator -> getContentAccessComponent ( ) ; $ filePath = $ path . '/' . $ assetFile -> getName ( ) ; return file_put_contents ( $ filePath , fopen ( $ downloadUrl , 'r' ) ) ; }
Download asset file to a local path.

@param AssetFile $assetFile Asset file to download
@param Locator   $locator   Read locator for downloading the asset file
@param string    $path      Destination root path

@return int
Download asset file to a local path .