Ejemplo n.º 1
0
function downloadaFile()
{
    $ft = new FileTransfer($_SESSION['sHost'], $_SESSION['sApp'], $_SESSION['sUserAgent']);
    $var0 = trim($_POST['token'], " ");
    $ft->setAuthToken($var0);
    $var1 = trim($_POST['durl'], " ");
    $ft->setAuthToken($var0);
    if (isset($_POST['psw'])) {
        $var2 = trim($_POST['psw'], " ");
        $response = $ft->downloadaFileWS($var1, $var2);
    } else {
        $response = $ft->downloadaFileWS($var1);
    }
    if ($response !== 'fail') {
        header("Location: {$response}");
    } else {
        header("Location: ./dwn.php?err=3");
    }
}
Ejemplo n.º 2
0
 public function downloada_file($download_url = null)
 {
     $ft = new \FileTransfer(\Session::get('ysi.sHost'), \Session::get('ysi.sApp'), \Session::get('ysi.sUserAgent'));
     $ft->setAuthToken(\Session::get('ysi.sToken'));
     $response = $ft->downloadaFileWS(trim($download_url));
     if ($response !== 'fail') {
         header("Location: {$response}");
     } else {
         echo '<h3>There was an error while downloading file.</h3>';
     }
     exit;
 }