
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.59 KB | hits: 7 | expires: Never
Download a remote file (2GB) using PHP
<?php
set_time_limit(0)
$local_file = 'file.zip';
$server_file = '/www/file.zip';
$conn_id = ftp_connect("ftp.webmashing.com");
$login_result = ftp_login($conn_id, "USERNAME", "PASSWORD");
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_filen";
} else {
echo "There was a problemn";
}
ftp_close($conn_id);
?>
bool ftp_pasv ( resource $ftp_stream , bool $pasv )
$conn_id = ftp_connect("ftp.webmashing.com");
$login_result = ftp_login($conn_id, "USERNAME", "PASSWORD");
ftp_pasv($conn_id, true);