├── Keep2ShareAPI.php ├── README.md ├── cli command ├── README.md ├── partnercli-linux.zip ├── partnercli-macos.zip └── partnercli-win.exe.zip ├── exampleAPI.php ├── index.html └── uploadFile.sh /Keep2ShareAPI.php: -------------------------------------------------------------------------------- 1 | username = $username; 79 | $this->password = $password; 80 | 81 | $this->_ch = curl_init(); 82 | curl_setopt($this->_ch, CURLOPT_POST, true); 83 | curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true); 84 | curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, 2); 85 | 86 | $this->_auth_token = $this->getAuthToken(); 87 | } 88 | 89 | /** 90 | * @param null $captcha_challenge 91 | * @param null $captcha_response 92 | * @param null $re_captcha_challenge 93 | * @param null $re_captcha_response 94 | * @return bool|int True if success login or error code 95 | */ 96 | public function login($captcha_challenge = null, $captcha_response = null, $re_captcha_challenge = null, $re_captcha_response = null) 97 | { 98 | curl_setopt($this->_ch, CURLOPT_URL, $this->baseUrl . 'login'); 99 | 100 | $params = [ 101 | 'username' => $this->username, 102 | 'password' => $this->password, 103 | ]; 104 | 105 | if ($captcha_challenge) 106 | $params['captcha_challenge'] = $captcha_challenge; 107 | 108 | if ($captcha_response) 109 | $params['captcha_response'] = $captcha_response; 110 | 111 | if ($re_captcha_challenge) 112 | $params['re_captcha_challenge'] = $re_captcha_challenge; 113 | 114 | if ($re_captcha_response) 115 | $params['re_captcha_response'] = $re_captcha_response; 116 | 117 | curl_setopt($this->_ch, CURLOPT_POSTFIELDS, json_encode($params)); 118 | $response = curl_exec($this->_ch); 119 | 120 | if ($this->verbose) { 121 | echo '>> ' . json_encode($params), PHP_EOL; 122 | echo '<< ' . $response, PHP_EOL; 123 | echo '-------------------------' . PHP_EOL; 124 | } 125 | $data = json_decode($response, true); 126 | 127 | if (!$data || !isset($data['status'])) { 128 | self::log('Authentication failed', 'warning'); 129 | return false; 130 | } 131 | 132 | if ($data['status'] == 'success') { 133 | $this->setAuthToken($data['auth_token']); 134 | $this->_auth_token = $data['auth_token']; 135 | return true; 136 | } else { 137 | self::log('Authentication failed: ' . $data['message'], 'warning'); 138 | return $data['errorCode']; 139 | } 140 | } 141 | 142 | /** 143 | * Make request 144 | * 145 | * @param $action 146 | * @param array $params 147 | * @return bool|mixed 148 | */ 149 | public function request($action, $params = array()) 150 | { 151 | if ($this->access_token) { 152 | if (!(empty($this->username) && empty($this->password))) { 153 | self::log('You can not simultaneously use the token and login/password per request', 'warning'); 154 | return false; 155 | } 156 | $params['access_token'] = $this->access_token; 157 | } 158 | 159 | if($this->_auth_token) { 160 | $params['auth_token'] = $this->_auth_token; 161 | } 162 | 163 | curl_setopt($this->_ch, CURLOPT_URL, $this->baseUrl . $action); 164 | curl_setopt($this->_ch, CURLOPT_POSTFIELDS, json_encode($params)); 165 | $response = curl_exec($this->_ch); 166 | 167 | if ($this->verbose) { 168 | echo "> action: {$action}", PHP_EOL; 169 | echo '>> ' . json_encode($params), PHP_EOL; 170 | echo '<< ' . $response, PHP_EOL; 171 | echo '-------------------------' . PHP_EOL; 172 | } 173 | 174 | $data = json_decode($response, true); 175 | if ($data['status'] == 'error' && isset($data['code']) && $data['code'] == 403) { 176 | if ($this->_allowAuth) { 177 | $this->login(); 178 | $this->_allowAuth = false; 179 | return $this->request($action, $params); 180 | } else { 181 | return false; 182 | } 183 | } 184 | return $data; 185 | } 186 | 187 | public function getCode($days, $autoBuy = true, $useExist = true) 188 | { 189 | $data = $this->request('resellerGetCode', array( 190 | 'days' => $days, 191 | 'autoBuy' => $autoBuy, 192 | 'useExist' => $useExist, 193 | )); 194 | if (!isset($data['status']) || $data['status'] != 'success') { 195 | $err = 'Error get code'; 196 | if (isset($data['message'])) { 197 | $err .= ' :' . $data['message']; 198 | } 199 | self::log($err, 'warning'); 200 | return false; 201 | } else { 202 | return $data; 203 | } 204 | } 205 | 206 | public function getFilesList($parent = '/', $limit = 100, $offset = 0, array $sort = [], $type = 'any', 207 | $only_available = false, $extended_info = false) 208 | { 209 | return $this->request('getFilesList', array( 210 | 'parent' => $parent, 211 | 'limit' => $limit, 212 | 'offset' => $offset, 213 | 'sort' => $sort, 214 | 'type' => $type, 215 | 'only_available' => $only_available, 216 | 'extended_info' => $extended_info, 217 | )); 218 | } 219 | 220 | public function createFolder($name, $parent = '/', $access = Keep2ShareAPI::FILE_ACCESS_PUBLIC, $is_public = false) 221 | { 222 | return $this->request('createFolder', array( 223 | 'name' => $name, 224 | 'parent' => $parent, 225 | 'access' => $access, 226 | 'is_public' => $is_public, 227 | )); 228 | } 229 | 230 | public function updateFiles($ids = [], $new_name = null, $new_parent = null, $new_access = null, $new_is_public = null) 231 | { 232 | return $this->request('updateFiles', array( 233 | 'ids' => $ids, 234 | 'new_name' => $new_name, 235 | 'new_parent' => $new_parent, 236 | 'new_access' => $new_access, 237 | 'new_is_public' => $new_is_public, 238 | )); 239 | } 240 | 241 | public function updateFile($id, $new_name = null, $new_parent = null, $new_access = null, $new_is_public = null) 242 | { 243 | return $this->request('updateFile', array( 244 | 'id' => $id, 245 | 'new_name' => $new_name, 246 | 'new_parent' => $new_parent, 247 | 'new_access' => $new_access, 248 | 'new_is_public' => $new_is_public, 249 | )); 250 | } 251 | 252 | public function getBalance() 253 | { 254 | return $this->request('getBalance'); 255 | } 256 | 257 | public function getFilesInfo(array $ids, $extended_info = false) 258 | { 259 | return $this->request('getFilesInfo', array( 260 | 'ids' => $ids, 261 | 'extended_info' => $extended_info, 262 | )); 263 | } 264 | 265 | public function remoteUploadAdd(array $urls) 266 | { 267 | return $this->request('remoteUploadAdd', array( 268 | 'urls' => $urls, 269 | )); 270 | } 271 | 272 | public function deleteFiles(array $ids) 273 | { 274 | return $this->request('deleteFiles', array( 275 | 'ids' => $ids, 276 | )); 277 | } 278 | 279 | public function remoteUploadStatus(array $ids) 280 | { 281 | return $this->request('remoteUploadStatus', array( 282 | 'ids' => $ids, 283 | )); 284 | } 285 | 286 | public function findFile($md5) 287 | { 288 | return $this->request('findFile', array( 289 | 'md5' => $md5, 290 | )); 291 | } 292 | 293 | public function createFileByHash($md5, $name, $parent = null, $access = Keep2ShareAPI::FILE_ACCESS_PUBLIC) 294 | { 295 | return $this->request('createFileByHash', array( 296 | 'hash' => $md5, 297 | 'name' => $name, 298 | 'parent' => $parent, 299 | 'access' => $access, 300 | )); 301 | } 302 | 303 | public function getUploadFormData($parent_id = null, $preferred_node = null) 304 | { 305 | return $this->request('getUploadFormData', ['parent_id' => $parent_id, 'preferred_node' => $preferred_node]); 306 | } 307 | 308 | public function test() 309 | { 310 | $response = $this->request('test'); 311 | return $response; 312 | } 313 | 314 | /** 315 | * @param $file 316 | * @param null $parent_id ID of existing folder 317 | * @param null $preferred_node 318 | * @return bool|mixed 319 | * @throws Exception You can use parent_id OR parent_name for specify file folder 320 | */ 321 | public function uploadFile($file, $parent_id = null, $preferred_node = null) 322 | { 323 | if (!is_file($file)) { 324 | throw new Exception("File '{$file}' is not found"); 325 | } 326 | 327 | $sha1 = $this->getFirst5MbFileSha1Hash($file); 328 | $sha1FindResult = $this->findBySha1Hash($sha1); 329 | 330 | if (!isset($sha1FindResult['exists'])) { 331 | throw new Exception('Incorrect params, expected "exists" parameter'); 332 | } 333 | 334 | if ($sha1FindResult['exists']) { 335 | $md5 = md5_file($file); 336 | $md5FindResult = $this->findByMd5Hash($md5); 337 | if (!isset($md5FindResult['exists'])) { 338 | throw new Exception('Incorrect params, expectation "exists" parameter'); 339 | } 340 | if ($md5FindResult['exists']) { 341 | $createdFile = $this->createFileByHash($md5FindResult['md5'], basename($file), $parent_id); 342 | return [ 343 | 'status' => 'success', 344 | 'status_code' => 200, 345 | 'user_file_id' => $createdFile['id'], 346 | 'link' => $createdFile['link'], 347 | ]; 348 | } 349 | } 350 | 351 | $data = $this->getUploadFormData($parent_id, $preferred_node); 352 | if ($data['status'] == 'success') { 353 | $curl = curl_init(); 354 | 355 | $postFields = $data['form_data']; 356 | $postFields[$data['file_field']] = new CURLFile($file); 357 | 358 | curl_setopt_array($curl, [ 359 | CURLOPT_FOLLOWLOCATION => false, 360 | CURLOPT_RETURNTRANSFER => true, 361 | CURLOPT_URL => $data['form_action'], 362 | CURLOPT_POST => true, 363 | CURLOPT_POSTFIELDS => $postFields, 364 | ]); 365 | 366 | $response = curl_exec($curl); 367 | if ($this->verbose) { 368 | echo '<<', $response, PHP_EOL; 369 | } 370 | return json_decode($response, true); 371 | } else { 372 | self::log('Error uploading file : ' . print_r($data, true), 'error'); 373 | return false; 374 | } 375 | } 376 | 377 | public function getAccountInfo() 378 | { 379 | return $this->request('accountInfo'); 380 | } 381 | 382 | public function requestCaptcha() 383 | { 384 | return $this->request('requestCaptcha'); 385 | } 386 | 387 | public function getUrl($file_id, $free_download_key = null, $captcha_challenge = null, $captcha_response = null) 388 | { 389 | return $this->request('getUrl', [ 390 | 'file_id' => $file_id, 391 | 'free_download_key' => $free_download_key, 392 | 'captcha_challenge' => $captcha_challenge, 393 | 'captcha_response' => $captcha_response, 394 | ]); 395 | } 396 | 397 | public function search($keywords, $operator = 'or', $sort = 'score', 398 | $limit = 20, $offset = 0, $ip_client = null) 399 | { 400 | return $this->request('search', [ 401 | 'keywords' => $keywords, 402 | 'operator' => $operator, 403 | 'sort' => $sort, 404 | 'limit' => $limit, 405 | 'offset' => $offset, 406 | 'ip_client' => $ip_client, 407 | ]); 408 | } 409 | 410 | public static function log($msg, $level) 411 | { 412 | echo $level . ': ' . $msg . PHP_EOL; 413 | } 414 | 415 | private function setAuthToken($key) 416 | { 417 | // $cache = new Memcache(); 418 | // $cache->addserver('127.0.0.1'); 419 | // $cache->set('Keep2ShareApiAuthToken', $key, 0, 1800); 420 | 421 | $temp_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5($this->username) . '_k2s.api.key'; 422 | file_put_contents($temp_file, $key); 423 | } 424 | 425 | private function getAuthToken() 426 | { 427 | // $cache = new Memcache(); 428 | // $cache->addserver('127.0.0.1'); 429 | // return $cache->get('Keep2ShareApiAuthToken'); 430 | 431 | $temp_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5($this->username) . '_k2s.api.key'; 432 | return is_file($temp_file) ? file_get_contents($temp_file) : false; 433 | } 434 | 435 | /** 436 | * Get SHA1 by first 5MB of the file 437 | * 438 | * @throws Exception 439 | * @param string $filePath 440 | * @return string 441 | */ 442 | private function getFirst5MbFileSha1Hash($filePath) 443 | { 444 | // Check file for existence 445 | if (!file_exists($filePath)) { 446 | throw new Exception('File not found'); 447 | } 448 | 449 | try { 450 | // Read the file 451 | $handle = fopen($filePath, 'r'); 452 | $fileChunk = fread($handle, self::CHUNK_HASH_SIZE); 453 | fclose($handle); 454 | } catch (Exception $exception) { 455 | throw new Exception('Can\'t read the file'); 456 | } 457 | 458 | return sha1($fileChunk); 459 | } 460 | 461 | /** 462 | * Make a request and check file existence by sha1([FILE_FIRST_5_MB]) 463 | * 464 | * Annotation: 465 | * 1. Read the first 5 megabytes from your file 466 | * 2. Convert this data into sha1 algorithm 467 | * 468 | * @param string $sha1 469 | * @return array|null 470 | */ 471 | private function findBySha1Hash($sha1) 472 | { 473 | return $this->request('findByFirst5MbSha1Hash', [ 474 | 'sha1' => $sha1, 475 | ]); 476 | } 477 | 478 | /** 479 | * Make a request and check file existence by md5([FILE]) 480 | * 481 | * Annotation: 482 | * 1. Read the file 483 | * 2. Convert this data into md5 algorithm 484 | * 485 | * @param string $md5 486 | * @return bool 487 | */ 488 | private function findByMd5Hash($md5) 489 | { 490 | return $this->request('findByFullMd5Hash', [ 491 | 'md5' => $md5, 492 | ]); 493 | } 494 | 495 | /** 496 | * @param int $id 497 | * @param int $limit Only for folders 498 | * @param int $offset Only for folders 499 | * @return array 500 | */ 501 | public function getFileStatus($id, $limit = 100, $offset = 0) 502 | { 503 | return $this->request('GetFileStatus', [ 504 | 'id' => $id, 505 | 'limit' => $limit, 506 | 'offset' => $offset, 507 | ]); 508 | } 509 | } 510 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### API base URLs 2 | - Keep2Share: https://keep2share.cc/api/v2/ 3 | - Tezfiles: https://tezfiles.com/api/v2/ 4 | - FileBoom: https://fboom.me/api/v2/ 5 | 6 | Our API supports three projects, each with its own base URL. 7 | 8 | ⚠️ Please ensure you use the correct base URL for the specific project you're working with. 9 | 10 | ### API documentation 11 | 12 | https://keep2share.github.io/api/ 13 | -------------------------------------------------------------------------------- /cli command/README.md: -------------------------------------------------------------------------------- 1 | # CLI command v.1.3.9 2 | 3 | The latest version. 4 | 5 | * We added loader while file uploading to the server. 6 | * Fixed some bugs. 7 | 8 | # CLI command v.1.3.7 9 | 10 | * We added `-n` parameter. You can specify the project and get the appropriate domain for links. 11 | * We improved an uploading files speed. 12 | 13 | ## USAGE 14 | $ partnercli upload 15 | 16 | ## OPTIONS 17 | -a, --access-token=access-token (required) access token from your profile 18 | -c, --path-to-csv=path-to-csv [default: upload_log.csv] local path to generated result file 19 | -d, --destination-folder=destination-folder folder Id on server 20 | -j, --stdout-json=stdout-json stdout in json format 21 | -n, --domain-name=k2s|fb|p2m|tz [default: k2s] domain name for generated URLs 22 | -s, --source-folder=source-folder (required) path to local folder 23 | 24 | ## ALIASES 25 | $ partnercli u 26 | $ partnercli upl 27 | 28 | # CLI command v.1.1.5 29 | 30 | Fixed some bugs. 31 | 32 | # CLI command v.1.1.4 33 | 34 | ## USAGE 35 | $ partnercli upload 36 | 37 | ## OPTIONS 38 | -a, --access-token=access-token (required) access token from your profile 39 | -c, --path-to-csv=path-to-csv [default: upload_log.csv] local path to generated result file 40 | -d, --destination-folder=destination-folder folder Id on server 41 | -j, --stdout-json=stdout-json stdout in json format 42 | -s, --source-folder=source-folder (required) path to local folder 43 | 44 | ## ALIASES 45 | $ partnercli u 46 | $ partnercli upl 47 | 48 | # CLI command v.1.1.3 49 | 50 | ## Examples 51 | $ ./partnercli-macos help upload 52 | 53 | Upload files on server 54 | 55 | ### USAGE 56 | $ partnercli upload 57 | 58 | ### OPTIONS 59 | -a, --access-token=access-token (required) access token from your profile 60 | -c, --path-to-csv=path-to-csv [default: upload_log.csv] local path to generated result file 61 | -d, --destination-folder=destination-folder folder Id on server 62 | -j, --stdout-json=stdout-json stdout in json format 63 | -s, --source-folder=source-folder (required) path to local folder 64 | 65 | ### ALIASES 66 | $ partnercli u 67 | $ partnercli upl 68 | 69 | # CLI command v.0.0.0 70 | 71 | There are things it can do for you: 72 | - Upload a specific file from your computer 73 | - Upload files from specific folder from your computer 74 | - Create the CSV file with operetion's result. 75 | 76 | CLI command checks the hash of file before uploading. 77 | 78 | 79 | ## Examples: 80 | 81 | $ ./partnercli-macos help upload 82 | 83 | Upload files on server 84 | 85 | ### USAGE 86 | $ partnercli upload 87 | 88 | ### OPTIONS 89 | 90 | -a, --access-token=access-token (required) access token from your profile 91 | -c, --path-to-csv=path-to-csv [default: upload_log.csv] local path to generated result file 92 | -d, --destination-folder=destination-folder folder Id on server 93 | -s, --source-folder=source-folder (required) path to local folder 94 | -------------------------------------------------------------------------------- /cli command/partnercli-linux.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keep2share/api/f20be05b9bcfa5f62fa0c2c80b5749f6504392f1/cli command/partnercli-linux.zip -------------------------------------------------------------------------------- /cli command/partnercli-macos.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keep2share/api/f20be05b9bcfa5f62fa0c2c80b5749f6504392f1/cli command/partnercli-macos.zip -------------------------------------------------------------------------------- /cli command/partnercli-win.exe.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keep2share/api/f20be05b9bcfa5f62fa0c2c80b5749f6504392f1/cli command/partnercli-win.exe.zip -------------------------------------------------------------------------------- /exampleAPI.php: -------------------------------------------------------------------------------- 1 | username='your_email'; 9 | $api->password='your_password'; 10 | */ 11 | 12 | //connect using access_token, add it here https://moneyplatform.biz/token/api.html 13 | $api->access_token = 'your_access_token'; 14 | 15 | //getFilesList 16 | var_dump($api->getFilesList('/', 10, 0, ['date_created'=>-1], 'files')); 17 | /* 18 | array(3) { 19 | ["status"]=> 20 | string(7) "success" 21 | ["code"]=> 22 | int(200) 23 | ["files"]=> 24 | array(1) { 25 | [0]=> 26 | array(4) { 27 | ["id"]=> 28 | string(13) "522f0bf5672f8" 29 | ["name"]=> 30 | string(9) "README.md" 31 | ["is_available"]=> 32 | bool(true) 33 | ["is_folder"]=> 34 | bool(false) 35 | ["date_created"]=> 36 | string(19) "2014-03-31 16:24:40" 37 | ["size"]=> 38 | string(4) "2857" 39 | } 40 | } 41 | } 42 | */ 43 | 44 | // Upload file 45 | var_dump($api->uploadFile('PATH-TO-LOCAL-FILE')); 46 | /* 47 | * array (size=5) 48 | 'status' => string 'success' (length=7) 49 | 'success' => boolean true 50 | 'status_code' => int 200 51 | 'user_file_id' => string 'cd4540513fe4d' (length=13) 52 | 'link' => string 'https://k2s.cc/file/cd4540513fe4d' (length=33) 53 | */ 54 | 55 | //Download file from premium account 56 | var_dump($api->GetUrl('ID-FILE')); 57 | /* 58 | array(3) { 59 | ["status"]=> 60 | string(7) "success" 61 | ["code"]=> 62 | int(200) 63 | ["url"]=> 64 | string(351) "https://prx-128.keep2share.cc/e1079d8df1646/2792f8cb58038/4179479b4....." 65 | } 66 | 67 | error limit exceed 68 | array(5) { 69 | ["message"]=> 70 | string(25) "Download is not available" 71 | ["status"]=> 72 | string(5) "error" 73 | ["code"]=> 74 | int(406) 75 | ["errorCode"]=> 76 | int(21) 77 | ["errors"]=> 78 | array(1) { 79 | [0]=> 80 | array(2) { 81 | ["code"]=> 82 | int(2) 83 | ["message"]=> 84 | string(20) "Traffic limit exceed" 85 | } 86 | } 87 | } 88 | */ 89 | -------------------------------------------------------------------------------- /uploadFile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################################ 4 | # Script demonstrates how to upload file to keep2share 5 | # 6 | # Dependencies: 7 | # curl - transfer a URL 8 | # jq - Command-line JSON processor (http://stedolan.github.io/jq/download/) 9 | # 10 | # Script was tested on Ubuntu 13.10 (64-bit, kernel 3.11.0-13-generic) 11 | ################################################################################ 12 | 13 | user="your_email" 14 | password="your_password" 15 | url="http://keep2share.cc/api/v1/" 16 | # Temporary file for error curl execution 17 | tempError="outputCurl.txt" 18 | 19 | # Check status from server response 20 | # If status not "success" program will terminate 21 | function checkStatus(){ 22 | local json=$1 23 | local action=$2 24 | status=$(echo "$json" | jq -r ".status") 25 | 26 | if [ "$status" == "success" ]; then 27 | echo -e "===> $action is \e[32mOK\e[0m" 28 | else 29 | echo -e "===> $action is \e[31mFAILD\e[0m" 30 | echo "[message] :" $(echo "$json" | jq ".message") 31 | echo "[code] :" $(echo "$json" | jq ".code") 32 | echo "Curl execution output:" 33 | cat "$tempError" 34 | rm "$tempError" 35 | exit 1 36 | fi 37 | } 38 | 39 | ################################################################################ 40 | # Authorization 41 | # 42 | 43 | # Run command for authorization 44 | cmd="curl -d '{\"username\":\"$user\",\"password\":\"$password\"}' "$url"login 2>$tempError" 45 | # Get response from server 46 | resLogin=`eval $cmd` 47 | 48 | # Look for an authorization status 49 | checkStatus "$resLogin" "Authentacation" 50 | 51 | # Get authorization token 52 | auth_token=$(echo "$resLogin" | jq -r ".auth_token") 53 | 54 | 55 | ################################################################################ 56 | # Upload file 57 | # 58 | 59 | cmd="curl -d '{\"auth_token\":\"$auth_token\"}' "$url"GetUploadFormData 2>$tempError" 60 | resForm=`eval $cmd` 61 | 62 | # Look for an form data status 63 | checkStatus "$resForm" "Getting form data" 64 | 65 | # File which we are going to upload on server 66 | fileName="exampleAPI.php" 67 | 68 | # Url for upload 69 | form_action=$(echo "$resForm" | jq -r ".form_action") 70 | # Required params for uploading file 71 | file_field=$(echo "$resForm" | jq -r ".file_field") 72 | nodeName=$(echo "$resForm" | jq -r ".form_data.nodeName") 73 | userId=$(echo "$resForm" | jq -r ".form_data.userId") 74 | expires=$(echo "$resForm" | jq -r ".form_data.expires") 75 | hmac=$(echo "$resForm" | jq -r ".form_data.hmac") 76 | api_request=$(echo "$resForm" | jq -r ".form_data.api_request") 77 | 78 | # Run command for upload file 79 | cmd="curl -F '$file_field=@$fileName' -F 'hmac=$hmac' -F 'expires=$expires' -F 'userId=$userId' -F 'nodeName=$nodeName' -F 'api_request=$api_request' "$form_action" 2>$tempError" 80 | resUpload=`eval $cmd` 81 | 82 | # Response server after uploading file 83 | checkStatus "$resUpload" "Uploading file to server" 84 | 85 | echo "Response: $resUpload" 86 | 87 | # Delete temporary file 88 | rm "$tempError" 89 | --------------------------------------------------------------------------------