Skip to main content
2 of 2
added 43 characters in body

Try

$pickupFile = new Varien_Io_Ftp();

$localDir = "/path/to/local/dir";
$remoteFile = "/path/to/remote/dir/text.csv"

mkdir($localDir, 0700, true);


$localFile = $localDir . '/local.csv'
try {
    $pickupFile->open(
        array(
            'host'      => $host,
            'user'      => $username,
            'password'  => $password,
            'timeout'   => '10'
        )
    );

    $pickupFile->read($remoteFile, $localFile);


} catch (Exception $e) {
    var_dump($e);
}

See Varien_Io_Ftp

Also for security you way want to use Varien_Io_Sftp