Skip to main content
added 43 characters in body
Source Link

Try

$pickupFile = new Varien_Io_Ftp();

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

mkdir($localFile$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

Try

$pickupFile = new Varien_Io_Ftp();

$localFile = "/path/to/local/dir";
$remoteFile = "/path/to/remote/dir/text.txt"

mkdir($localFile, 0700, true);

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

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

Source Link

Try

$pickupFile = new Varien_Io_Ftp();

$localFile = "/path/to/local/dir";
$remoteFile = "/path/to/remote/dir/text.txt"

mkdir($localFile, 0700, true);

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