public function onReceive($client, $data) { $remote_info = json_decode($data, true); if ($remote_info['type'] == 'filesizemes') { if ($client->sendfile(MYPATH . $remote_info['data']['path'])) { } } }