public function upload($ftkey, $seek, $data)
  {
    $this->init($ftkey);

    $size = strlen($data);
    $seek = intval($seek);
    $pack = 4096;

    \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadStarted", $ftkey, $seek, $size);

    for(;$seek < $size;)
    {
      $rest = $size-$seek;
      $pack = $rest < $pack ? $rest : $pack;
      $buff = substr($data, $seek, $pack);
      $seek = $seek+$pack;

      $this->getTransport()->send($buff);

      \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadProgress", $ftkey, $seek, $size);
    }

    $this->getProfiler()->stop();

    \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadFinished", $ftkey, $seek, $size);

    if($seek < $size)
    {
      throw new FileTransfer\Exception("incomplete file upload (" . $seek . " of " . $size . " bytes)");
    }
  }
public function upload($ftkey, $seek, $data)
  {
    $this->init($ftkey);

    $size = strlen($data);
    $seek = intval($seek);
    $pack = 4096;

    \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadStarted", $ftkey, $seek, $size);

    for(;$seek < $size;)
    {
      $rest = $size-$seek;
      $pack = $rest < $pack ? $rest : $pack;
      $buff = substr($data, $seek, $pack);
      $seek = $seek+$pack;

      $this->getTransport()->send($buff);

      \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadProgress", $ftkey, $seek, $size);
    }

    $this->getProfiler()->stop();

    \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit("filetransferUploadFinished", $ftkey, $seek, $size);

    if($seek < $size)
    {
      throw new FileTransfer\Exception("incomplete file upload (" . $seek . " of " . $size . " bytes)");
    }
  }
public function upload ( $ ftkey , $ seek , $ data ) { $ this -> init ( $ ftkey ) ; $ size = strlen ( $ data ) ; $ seek = intval ( $ seek ) ; $ pack = 4096 ; \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Helper \ Signal :: getInstance ( ) -> emit ( "filetransferUploadStarted" , $ ftkey , $ seek , $ size ) ; for ( ; $ seek < $ size ; ) { $ rest = $ size - $ seek ; $ pack = $ rest < $ pack ? $ rest : $ pack ; $ buff = substr ( $ data , $ seek , $ pack ) ; $ seek = $ seek + $ pack ; $ this -> getTransport ( ) -> send ( $ buff ) ; \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Helper \ Signal :: getInstance ( ) -> emit ( "filetransferUploadProgress" , $ ftkey , $ seek , $ size ) ; } $ this -> getProfiler ( ) -> stop ( ) ; \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Helper \ Signal :: getInstance ( ) -> emit ( "filetransferUploadFinished" , $ ftkey , $ seek , $ size ) ; if ( $ seek < $ size ) { throw new FileTransfer \ Exception ( "incomplete file upload (" . $ seek . " of " . $ size . " bytes)" ) ; } }
Sends the content of a file to the server.

@param  string  $ftkey
@param  integer $seek
@param  string  $data
@throws FileTransfer\Exception
@return void
Sends the content of a file to the server .