src/Uploadcare/Api.php
public function createRemoteCopy($source, $target, $make_public = true, $pattern = null)
    {
        if (!$target) {
            throw new \Exception('$target parameter should not be empty.');
        }
        $paramArr = array('source' => $source, 'target' => $target, 'make_public' => $make_public);
        if ($pattern) {
            $paramArr['pattern'] = $pattern;
        }
        $data = $this->__preparedRequest('file_copy', 'POST', array(), $paramArr);
        if (array_key_exists('result', (array)$data) == true) {
            return (string)$data->result;
        } else {
            return (string)$data->detail;
        }
    }
public function createRemoteCopy($source, $target, $make_public = true, $pattern = null)
    {
        if (!$target) {
            throw new \Exception('$target parameter should not be empty.');
        }
        $paramArr = array('source' => $source, 'target' => $target, 'make_public' => $make_public);
        if ($pattern) {
            $paramArr['pattern'] = $pattern;
        }
        $data = $this->__preparedRequest('file_copy', 'POST', array(), $paramArr);
        if (array_key_exists('result', (array)$data) == true) {
            return (string)$data->result;
        } else {
            return (string)$data->detail;
        }
    }
public function createRemoteCopy ( $ source , $ target , $ make_public = true , $ pattern = null ) { if ( ! $ target ) { throw new \ Exception ( '$target parameter should not be empty.' ) ; } $ paramArr = array ( 'source' => $ source , 'target' => $ target , 'make_public' => $ make_public ) ; if ( $ pattern ) { $ paramArr [ 'pattern' ] = $ pattern ; } $ data = $ this -> __preparedRequest ( 'file_copy' , 'POST' , array ( ) , $ paramArr ) ; if ( array_key_exists ( 'result' , ( array ) $ data ) == true ) { return ( string ) $ data -> result ; } else { return ( string ) $ data -> detail ; } }
Copy file to the external storage

@param string $source CDN URL or file's uuid you need to copy.
@param string $target Name of custom storage connected to your project. Uploadcare storage is used if target is absent.
@param boolean $make_public (Optional) MUST be either true or false. true to make copied files available via public links. false to reverse the behavior.
@param string $pattern (Optional) Applies to custom storage usage scenario only. The parameter is used to specify file names Uploadcare passes to custom storages. In case parameter is omitted, custom storage pattern is used.

Allowed values:

${default} = ${uuid}/${auto_filename}
${auto_filename} = ${filename} ${effects} ${ext}
${effects} = CDN operations put into a URL
${filename} = original filename, no extension
${uuid} = file UUID
${ext} = file extension, leading dot, e.g. .jpg

@return string
@throws \Exception
Copy file to the external storage