Exemple #1
0
 /**
  * Returns the upload link
  *
  * @param string|Folder $folder   The folder id
  * @param string        $sha1     The sha1 of file to upload
  * @param bool          $httpOnly If this is set to true, use only http upload links
  *
  * @return UploadLink
  */
 public function getUploadLink($folder = null, $sha1 = null, $httpOnly = false)
 {
     $params = $this->getAuthParams();
     if ($folder) {
         $params['folder'] = (string) $folder;
     }
     if ($sha1) {
         $params['sha1'] = (string) $sha1;
     }
     if ($httpOnly) {
         $params['httponly'] = true;
     }
     $response = $this->processRequest('file/ul', $params);
     $result = $this->processResponse($response);
     return LinkBuilder::buildUploadLink($result);
 }
Exemple #2
0
 /**
  * Tests the building of the download link
  */
 public function testBuildDownloadLink()
 {
     $data = json_decode($this->downloadFixture, true);
     $downloadLink = LinkBuilder::buildDownloadLink($data);
     $this->assertInstanceOf('Ideneal\\OpenLoad\\Entity\\DownloadLink', $downloadLink);
 }