public function uploadPartCopy($fromBucket, $fromObject, $toBucket, $toObject, $partNumber, $uploadId, $options = NULL)
    {
        $this->precheckCommon($fromBucket, $fromObject, $options);
        $this->precheckCommon($toBucket, $toObject, $options);

        //If $options['isFullCopy'] is not set, copy from the beginning
        $start_range = "0";
        if (isset($options['start'])) {
            $start_range = $options['start'];
        }
        $end_range = "";
        if (isset($options['end'])) {
            $end_range = $options['end'];
        }
        $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
        $options[self::OSS_BUCKET] = $toBucket;
        $options[self::OSS_OBJECT] = $toObject;
        $options[self::OSS_PART_NUM] = $partNumber;
        $options[self::OSS_UPLOAD_ID] = $uploadId;

        if (!isset($options[self::OSS_HEADERS])) {
            $options[self::OSS_HEADERS] = array();
        }

        $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = '/' . $fromBucket . '/' . $fromObject;
        $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE_RANGE] = "bytes=" . $start_range . "-" . $end_range;
        $response = $this->auth($options);
        $result = new UploadPartResult($response);
        return $result->getData();
    }
public function uploadPartCopy($fromBucket, $fromObject, $toBucket, $toObject, $partNumber, $uploadId, $options = NULL)
    {
        $this->precheckCommon($fromBucket, $fromObject, $options);
        $this->precheckCommon($toBucket, $toObject, $options);

        //If $options['isFullCopy'] is not set, copy from the beginning
        $start_range = "0";
        if (isset($options['start'])) {
            $start_range = $options['start'];
        }
        $end_range = "";
        if (isset($options['end'])) {
            $end_range = $options['end'];
        }
        $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
        $options[self::OSS_BUCKET] = $toBucket;
        $options[self::OSS_OBJECT] = $toObject;
        $options[self::OSS_PART_NUM] = $partNumber;
        $options[self::OSS_UPLOAD_ID] = $uploadId;

        if (!isset($options[self::OSS_HEADERS])) {
            $options[self::OSS_HEADERS] = array();
        }

        $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = '/' . $fromBucket . '/' . $fromObject;
        $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE_RANGE] = "bytes=" . $start_range . "-" . $end_range;
        $response = $this->auth($options);
        $result = new UploadPartResult($response);
        return $result->getData();
    }
public function uploadPartCopy ( $ fromBucket , $ fromObject , $ toBucket , $ toObject , $ partNumber , $ uploadId , $ options = NULL ) { $ this -> precheckCommon ( $ fromBucket , $ fromObject , $ options ) ; $ this -> precheckCommon ( $ toBucket , $ toObject , $ options ) ; //If $options['isFullCopy'] is not set, copy from the beginning $ start_range = "0" ; if ( isset ( $ options [ 'start' ] ) ) { $ start_range = $ options [ 'start' ] ; } $ end_range = "" ; if ( isset ( $ options [ 'end' ] ) ) { $ end_range = $ options [ 'end' ] ; } $ options [ self :: OSS_METHOD ] = self :: OSS_HTTP_PUT ; $ options [ self :: OSS_BUCKET ] = $ toBucket ; $ options [ self :: OSS_OBJECT ] = $ toObject ; $ options [ self :: OSS_PART_NUM ] = $ partNumber ; $ options [ self :: OSS_UPLOAD_ID ] = $ uploadId ; if ( ! isset ( $ options [ self :: OSS_HEADERS ] ) ) { $ options [ self :: OSS_HEADERS ] = array ( ) ; } $ options [ self :: OSS_HEADERS ] [ self :: OSS_OBJECT_COPY_SOURCE ] = '/' . $ fromBucket . '/' . $ fromObject ; $ options [ self :: OSS_HEADERS ] [ self :: OSS_OBJECT_COPY_SOURCE_RANGE ] = "bytes=" . $ start_range . "-" . $ end_range ; $ response = $ this -> auth ( $ options ) ; $ result = new UploadPartResult ( $ response ) ; return $ result -> getData ( ) ; }
Copy an existing file as a part

@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 int $partNumber Part number
@param string $uploadId Upload Id
@param array $options Key-Value array---it should have 'start' or 'end' key to specify the range of the source object to copy. If it's not specifed, the whole object is copied.
@return null
@throws OssException
Copy an existing file as a part