filestack/UploadProcessor.php
public function registerUploadTask($api_key, $metadata)
    {
        $data = [];
        $this->appendData($data, 'apikey',         $api_key);
        $this->appendData($data, 'filename',       $metadata['filename']);
        $this->appendData($data, 'mimetype',       $metadata['mimetype']);
        $this->appendData($data, 'size',           $metadata['filesize']);
        $this->appendData($data, 'store_location', $metadata['location']);
        $this->appendData($data, 'multipart',      true);

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

        $this->appendSecurity($data);

        $url = FilestackConfig::UPLOAD_URL . '/multipart/start';
        $response = $this->sendRequest('POST', $url, ['multipart' => $data]);
        $json = $this->handleResponseDecodeJson($response);

        return $json;
    }
public function registerUploadTask($api_key, $metadata)
    {
        $data = [];
        $this->appendData($data, 'apikey',         $api_key);
        $this->appendData($data, 'filename',       $metadata['filename']);
        $this->appendData($data, 'mimetype',       $metadata['mimetype']);
        $this->appendData($data, 'size',           $metadata['filesize']);
        $this->appendData($data, 'store_location', $metadata['location']);
        $this->appendData($data, 'multipart',      true);

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

        $this->appendSecurity($data);

        $url = FilestackConfig::UPLOAD_URL . '/multipart/start';
        $response = $this->sendRequest('POST', $url, ['multipart' => $data]);
        $json = $this->handleResponseDecodeJson($response);

        return $json;
    }
public function registerUploadTask ( $ api_key , $ metadata ) { $ data = [ ] ; $ this -> appendData ( $ data , 'apikey' , $ api_key ) ; $ this -> appendData ( $ data , 'filename' , $ metadata [ 'filename' ] ) ; $ this -> appendData ( $ data , 'mimetype' , $ metadata [ 'mimetype' ] ) ; $ this -> appendData ( $ data , 'size' , $ metadata [ 'filesize' ] ) ; $ this -> appendData ( $ data , 'store_location' , $ metadata [ 'location' ] ) ; $ this -> appendData ( $ data , 'multipart' , true ) ; array_push ( $ data , [ 'name' => 'files' , 'contents' => '' , 'filename' => $ metadata [ 'filename' ] ] ) ; $ this -> appendSecurity ( $ data ) ; $ url = FilestackConfig :: UPLOAD_URL . '/multipart/start' ; $ response = $ this -> sendRequest ( 'POST' , $ url , [ 'multipart' => $ data ] ) ; $ json = $ this -> handleResponseDecodeJson ( $ response ) ; return $ json ; }
Trigger the start of an upload task

@param string        $api_key        Filestack API Key
@param string        $metadata       metadata of file: filename, filesize,
mimetype, location

@throws FilestackException   if API call fails

@return json
Trigger the start of an upload task