public function nextChunk($chunk = false)
  {
    $resumeUri = $this->getResumeUri();

    if (false == $chunk) {
      $chunk = substr($this->data, $this->progress, $this->chunkSize);
    }

    $lastBytePos = $this->progress + strlen($chunk) - 1;
    $headers = array(
      'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
      'content-length' => strlen($chunk),
      'expect' => '',
    );

    $request = new Request(
        'PUT',
        $resumeUri,
        $headers,
        Psr7\stream_for($chunk)
    );

    return $this->makePutRequest($request);
  }
public function nextChunk($chunk = false)
  {
    $resumeUri = $this->getResumeUri();

    if (false == $chunk) {
      $chunk = substr($this->data, $this->progress, $this->chunkSize);
    }

    $lastBytePos = $this->progress + strlen($chunk) - 1;
    $headers = array(
      'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
      'content-length' => strlen($chunk),
      'expect' => '',
    );

    $request = new Request(
        'PUT',
        $resumeUri,
        $headers,
        Psr7\stream_for($chunk)
    );

    return $this->makePutRequest($request);
  }
public function nextChunk ( $ chunk = false ) { $ resumeUri = $ this -> getResumeUri ( ) ; if ( false == $ chunk ) { $ chunk = substr ( $ this -> data , $ this -> progress , $ this -> chunkSize ) ; } $ lastBytePos = $ this -> progress + strlen ( $ chunk ) - 1 ; $ headers = array ( 'content-range' => "bytes $this->progress-$lastBytePos/$this->size" , 'content-length' => strlen ( $ chunk ) , 'expect' => '' , ) ; $ request = new Request ( 'PUT' , $ resumeUri , $ headers , Psr7 \ stream_for ( $ chunk ) ) ; return $ this -> makePutRequest ( $ request ) ; }
Send the next part of the file to upload.
@param [$chunk] the next set of bytes to send. If false will used $data passed
at construct time.
Send the next part of the file to upload .