jul 052011
 
<?php
$conn_id = ftp_connect("servidor");
$login_result = ftp_login($conn_id, "user", "pass");
 
ftp_pasv($conn_id, true);
 
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
exit;
} else {
echo "Connected";
}
 
// get the file
$result = ftp_get($conn_id, "arquivo_local.xml","arquivo_remoto.xml", FTP_BINARY);
 
// check upload status
if (!$result) {
echo "FTP download has failed!";
} else {
echo "Downloaded ";
}
 
// close the FTP stream
ftp_close($conn_id);
?>

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>