Exemple #1
0
		case 'sendfile':
			set_time_limit(1200);
			$arVars = Array(
					'command_id' => $oRequest->arParameters['command_id'],
					'sendfile' => 'Y',
					);
			$oClientRequest = new CControllerClientRequestTo('query', $arVars);
			$oClientRequest->session_id = $oRequest->session_id;
			$oClientResponse = $oClientRequest->Send();

			if(is_object($oClientResponse) && $oClientResponse->Check())
			{
				if($oClientResponse->OK())
				{
					if (CControllerTools::UnpackFileArchive($oClientResponse->arParameters['file'], $oClientResponse->arParameters['path_to']))
					{
						$oResponse->status = "200 OK";
						$command = $oClientResponse->arParameters['command'];
						if (strlen($command) > 0 && CControllerClient::RunCommand($command, $oResponse, $oClientResponse) === false)
						{
							$oResponse->status = "450 Execution error";
						}
					}
					else
					{
						$oResponse->status = "451 Copy File error";
						$e = $APPLICATION->GetException();
						if(is_object($e))
							$oResponse->text = $e->GetString();
					}