public function CabinetAddFile($hid, $file_path, $title = false, $version = false, $description = false) { // $hid : base:IDType == string == integer (folder ID) // $file_path : add file location (string) // $title : (optional) file title // $version : integer (0 - ) // $description : string (optional) $this->CheckAndSetHeader(__FUNCTION__); $reg_args["hid"] = $hid; $basename = basename($file_path); $reg_args["name"] = $basename; if ($title !== false) { $reg_args["title"] = $title; } if ($version !== false) { $reg_args["version"] = $version; } if ($description !== false) { $reg_args["description"] = $description; } // file body $fp = fopen($file_path, "r"); if ($fp == false) { throw new CbgrnSoapFault("007", __FUNCTION__); } $this->encodeString($reg_args); // file body do not convert encoding $reg_args["content"] = fread($fp, filesize($file_path)); fclose($fp); $results = parent::CabinetAddFile($reg_args); $this->methodClose(); return $this->decodeString($results->file); }