if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') {return;}
if (empty($_POST['action'])) {return;}
    $url = 'https://download.wireguard.com/windows-client/wireguard-installer.exe';
    $output = array('success' => false, 'message' => '');
    $file_name = basename($url);
    if (file_put_contents('/var/www/modx/html/assets/'.$file_name, file_get_contents($url)))
    {
        $output = array('success' => true, 'message' => '/assets/downloads/wireguard-installer.exe');
    }
   $output = json_encode($output);
   die($output);