public function copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options = NULL)
    {
        $this->precheckCommon($fromBucket, $fromObject, $options);
        $this->precheckCommon($toBucket, $toObject, $options);
        $options[self::OSS_BUCKET] = $toBucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
        $options[self::OSS_OBJECT] = $toObject;
        if (isset($options[self::OSS_HEADERS])) {
            $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = '/' . $fromBucket . '/' . $fromObject;
        } else {
            $options[self::OSS_HEADERS] = array(self::OSS_OBJECT_COPY_SOURCE => '/' . $fromBucket . '/' . $fromObject);
        }
        $response = $this->auth($options);
        $result = new CopyObjectResult($response);
        return $result->getData();
    }
public function copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options = NULL)
    {
        $this->precheckCommon($fromBucket, $fromObject, $options);
        $this->precheckCommon($toBucket, $toObject, $options);
        $options[self::OSS_BUCKET] = $toBucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
        $options[self::OSS_OBJECT] = $toObject;
        if (isset($options[self::OSS_HEADERS])) {
            $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = '/' . $fromBucket . '/' . $fromObject;
        } else {
            $options[self::OSS_HEADERS] = array(self::OSS_OBJECT_COPY_SOURCE => '/' . $fromBucket . '/' . $fromObject);
        }
        $response = $this->auth($options);
        $result = new CopyObjectResult($response);
        return $result->getData();
    }
public function copyObject ( $ fromBucket , $ fromObject , $ toBucket , $ toObject , $ options = NULL ) { $ this -> precheckCommon ( $ fromBucket , $ fromObject , $ options ) ; $ this -> precheckCommon ( $ toBucket , $ toObject , $ options ) ; $ options [ self :: OSS_BUCKET ] = $ toBucket ; $ options [ self :: OSS_METHOD ] = self :: OSS_HTTP_PUT ; $ options [ self :: OSS_OBJECT ] = $ toObject ; if ( isset ( $ options [ self :: OSS_HEADERS ] ) ) { $ options [ self :: OSS_HEADERS ] [ self :: OSS_OBJECT_COPY_SOURCE ] = '/' . $ fromBucket . '/' . $ fromObject ; } else { $ options [ self :: OSS_HEADERS ] = array ( self :: OSS_OBJECT_COPY_SOURCE => '/' . $ fromBucket . '/' . $ fromObject ) ; } $ response = $ this -> auth ( $ options ) ; $ result = new CopyObjectResult ( $ response ) ; return $ result -> getData ( ) ; }
Copy from an existing OSS object to another OSS object. If the target object exists already, it will be overwritten.

@param string $fromBucket Source bucket name
@param string $fromObject Source object name
@param string $toBucket Target bucket name
@param string $toObject Target object name
@param array $options
@return null
@throws OssException
Copy from an existing OSS object to another OSS object . If the target object exists already it will be overwritten .