public function appendObject($bucket, $object, $content, $position, $options = NULL)
    {
        $this->precheckCommon($bucket, $object, $options);

        $options[self::OSS_CONTENT] = $content;
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
        $options[self::OSS_OBJECT] = $object;
        $options[self::OSS_SUB_RESOURCE] = 'append';
        $options[self::OSS_POSITION] = strval($position);

        if (!isset($options[self::OSS_LENGTH])) {
            $options[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
        } else {
            $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
        }
        
        $is_check_md5 = $this->isCheckMD5($options);
        if ($is_check_md5) {
        	$content_md5 = base64_encode(md5($content, true));
        	$options[self::OSS_CONTENT_MD5] = $content_md5;
        }

        if (!isset($options[self::OSS_CONTENT_TYPE])) {
            $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
        }
        $response = $this->auth($options);
        $result = new AppendResult($response);
        return $result->getData();
    }
public function appendObject($bucket, $object, $content, $position, $options = NULL)
    {
        $this->precheckCommon($bucket, $object, $options);

        $options[self::OSS_CONTENT] = $content;
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
        $options[self::OSS_OBJECT] = $object;
        $options[self::OSS_SUB_RESOURCE] = 'append';
        $options[self::OSS_POSITION] = strval($position);

        if (!isset($options[self::OSS_LENGTH])) {
            $options[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
        } else {
            $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
        }
        
        $is_check_md5 = $this->isCheckMD5($options);
        if ($is_check_md5) {
        	$content_md5 = base64_encode(md5($content, true));
        	$options[self::OSS_CONTENT_MD5] = $content_md5;
        }

        if (!isset($options[self::OSS_CONTENT_TYPE])) {
            $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
        }
        $response = $this->auth($options);
        $result = new AppendResult($response);
        return $result->getData();
    }
public function appendObject ( $ bucket , $ object , $ content , $ position , $ options = NULL ) { $ this -> precheckCommon ( $ bucket , $ object , $ options ) ; $ options [ self :: OSS_CONTENT ] = $ content ; $ options [ self :: OSS_BUCKET ] = $ bucket ; $ options [ self :: OSS_METHOD ] = self :: OSS_HTTP_POST ; $ options [ self :: OSS_OBJECT ] = $ object ; $ options [ self :: OSS_SUB_RESOURCE ] = 'append' ; $ options [ self :: OSS_POSITION ] = strval ( $ position ) ; if ( ! isset ( $ options [ self :: OSS_LENGTH ] ) ) { $ options [ self :: OSS_CONTENT_LENGTH ] = strlen ( $ options [ self :: OSS_CONTENT ] ) ; } else { $ options [ self :: OSS_CONTENT_LENGTH ] = $ options [ self :: OSS_LENGTH ] ; } $ is_check_md5 = $ this -> isCheckMD5 ( $ options ) ; if ( $ is_check_md5 ) { $ content_md5 = base64_encode ( md5 ( $ content , true ) ) ; $ options [ self :: OSS_CONTENT_MD5 ] = $ content_md5 ; } if ( ! isset ( $ options [ self :: OSS_CONTENT_TYPE ] ) ) { $ options [ self :: OSS_CONTENT_TYPE ] = $ this -> getMimeType ( $ object ) ; } $ response = $ this -> auth ( $ options ) ; $ result = new AppendResult ( $ response ) ; return $ result -> getData ( ) ; }
Append the object with the content at the specified position.
The specified position is typically the lengh of the current file.
@param string $bucket bucket name
@param string $object objcet name
@param string $content content to append
@param array $options
@return int next append position
@throws OssException
Append the object with the content at the specified position . The specified position is typically the lengh of the current file .