/** * @param $location * @param $local_file_path * * @return bool * @throws ilCloudException */ public function uploadFile($location, $local_file_path) { $this->setRequestType(self::REQ_TYPE_GET); $dirname = dirname($location); if ($dirname == '.') { $dirname = '/'; } $this->setRessource($this->getExodApp()->getRessource() . '/files/getByPath(\'' . rawurlencode($dirname) . '\')'); $this->request(); $folder = new exodFolder(); $folder->loadFromStdClass(json_decode($this->getResponseBody())); $name = rawurlencode(basename($location)); $finfo = finfo_open(FILEINFO_MIME_TYPE); $this->setRequestType(self::REQ_TYPE_PUT); $this->setRessource($this->getExodApp()->getRessource() . '/Files/' . $folder->getId() . '/children/' . $name . '/content'); $this->setRequestFilePath($local_file_path); $request_content_type = finfo_file($finfo, $local_file_path); $this->setRequestContentType($request_content_type); $this->request(); return true; }