/**
  * Get the Body of the Request
  *
  * @return resource
  */
 public function getBody()
 {
     return $this->file->getContents();
 }
示例#2
0
 /**
  * Make DropboxFile Object
  *
  * @param  string|DropboxFile $dropboxFile DropboxFile object or Path to file
  * @param int $maxLength   Max Bytes to read from the file
  * @param int $offset      Seek to specified offset before reading
  *
  * @return \Kunnu\Dropbox\DropboxFile
  */
 public function makeDropboxFile($dropboxFile, $maxLength = -1, $offset = -1)
 {
     //Uploading file by file path
     if (!$dropboxFile instanceof DropboxFile) {
         //File is valid
         if (is_file($dropboxFile)) {
             //Create a DropboxFile Object
             $dropboxFile = new DropboxFile($dropboxFile, $maxLength, $offset);
         } else {
             //File invalid/doesn't exist
             throw new DropboxClientException("File '{$dropboxFile}' is invalid.");
         }
     }
     $dropboxFile->setOffset($offset);
     $dropboxFile->setMaxLength($maxLength);
     //Return the DropboxFile Object
     return $dropboxFile;
 }