filestack/UploadProcessor.php
protected function registerComplete($api_key, $parts_etags, $upload_data,
                                          $metadata)
    {
        $data = [];
        $this->appendData($data, 'apikey',          $api_key);
        $this->appendData($data, 'uri',             $upload_data['uri']);
        $this->appendData($data, 'region',          $upload_data['region']);
        $this->appendData($data, 'upload_id',       $upload_data['upload_id']);

        $this->appendData($data, 'size',            $metadata['filesize']);
        $this->appendData($data, 'filename',        $metadata['filename']);
        $this->appendData($data, 'mimetype',        $metadata['mimetype']);
        $this->appendData($data, 'store_location',  $metadata['location']);
        $this->appendData($data, 'parts',           $parts_etags);

        if ($this->intelligent) {
            $this->appendData($data, 'multipart', true);
        }

        array_push($data, ['name' => 'files',
            'contents' => '',
            'filename' => $metadata['filename']
        ]);

        $this->appendSecurity($data);

        $url = FilestackConfig::UPLOAD_URL . '/multipart/complete';
        $response = $this->sendRequest('POST', $url, ['multipart' => $data]);
        $status_code = $response->getStatusCode();

        $filelink = null;
        if ($status_code == 200) {
            $filelink = $this->handleResponseCreateFilelink($response);
        }

        return ['status_code' => $status_code, 'filelink' => $filelink];
    }
protected function registerComplete($api_key, $parts_etags, $upload_data,
                                          $metadata)
    {
        $data = [];
        $this->appendData($data, 'apikey',          $api_key);
        $this->appendData($data, 'uri',             $upload_data['uri']);
        $this->appendData($data, 'region',          $upload_data['region']);
        $this->appendData($data, 'upload_id',       $upload_data['upload_id']);

        $this->appendData($data, 'size',            $metadata['filesize']);
        $this->appendData($data, 'filename',        $metadata['filename']);
        $this->appendData($data, 'mimetype',        $metadata['mimetype']);
        $this->appendData($data, 'store_location',  $metadata['location']);
        $this->appendData($data, 'parts',           $parts_etags);

        if ($this->intelligent) {
            $this->appendData($data, 'multipart', true);
        }

        array_push($data, ['name' => 'files',
            'contents' => '',
            'filename' => $metadata['filename']
        ]);

        $this->appendSecurity($data);

        $url = FilestackConfig::UPLOAD_URL . '/multipart/complete';
        $response = $this->sendRequest('POST', $url, ['multipart' => $data]);
        $status_code = $response->getStatusCode();

        $filelink = null;
        if ($status_code == 200) {
            $filelink = $this->handleResponseCreateFilelink($response);
        }

        return ['status_code' => $status_code, 'filelink' => $filelink];
    }
protected function registerComplete ( $ api_key , $ parts_etags , $ upload_data , $ metadata ) { $ data = [ ] ; $ this -> appendData ( $ data , 'apikey' , $ api_key ) ; $ this -> appendData ( $ data , 'uri' , $ upload_data [ 'uri' ] ) ; $ this -> appendData ( $ data , 'region' , $ upload_data [ 'region' ] ) ; $ this -> appendData ( $ data , 'upload_id' , $ upload_data [ 'upload_id' ] ) ; $ this -> appendData ( $ data , 'size' , $ metadata [ 'filesize' ] ) ; $ this -> appendData ( $ data , 'filename' , $ metadata [ 'filename' ] ) ; $ this -> appendData ( $ data , 'mimetype' , $ metadata [ 'mimetype' ] ) ; $ this -> appendData ( $ data , 'store_location' , $ metadata [ 'location' ] ) ; $ this -> appendData ( $ data , 'parts' , $ parts_etags ) ; if ( $ this -> intelligent ) { $ this -> appendData ( $ data , 'multipart' , true ) ; } array_push ( $ data , [ 'name' => 'files' , 'contents' => '' , 'filename' => $ metadata [ 'filename' ] ] ) ; $ this -> appendSecurity ( $ data ) ; $ url = FilestackConfig :: UPLOAD_URL . '/multipart/complete' ; $ response = $ this -> sendRequest ( 'POST' , $ url , [ 'multipart' => $ data ] ) ; $ status_code = $ response -> getStatusCode ( ) ; $ filelink = null ; if ( $ status_code == 200 ) { $ filelink = $ this -> handleResponseCreateFilelink ( $ response ) ; } return [ 'status_code' => $ status_code , 'filelink' => $ filelink ] ; }
Trigger the end of an upload task

@param string            $api_key        Filestack API Key
@param string            $parts_etags    parts:etags, semicolon separated
e.g. '1:etag_1;2:etag_2;3:etag_3
@param array             $upload_data    upload data from register
call: uri, region, upload_id
@param string            $metadata       metadata of file: filename,
filesize, mimetype, location

@throws FilestackException   if API call fails

@return json
Trigger the end of an upload task