Warning: ftp_get() [function.ftp-get]: Connection accepted i

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
padmanesh
Forum Newbie
Posts: 2
Joined: Fri Jan 18, 2013 5:03 am

Warning: ftp_get() [function.ftp-get]: Connection accepted i

Post by padmanesh »

I am facing a problem while downloading file from ftp.

my code is :

<?php

// define some variables
$local_file = 'd://my_file.sql';
$server_file = '/shared/abc.sql';
$ftp_server='ftp.xyz.net';

// set up basic connection
$conn_id = ftp_connect($ftp_server,21);

// login with username and password
$login_result = ftp_login($conn_id, 'abcd', '****');
ftp_pasv($conn_id,true);

// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_ASCII )) {
echo "Successfully written to $local_file";
} else {
echo "There was a problem";
}

// close the connection
ftp_close($conn_id);
?>

that showing the warning of:

Warning: ftp_get() [function.ftp-get]: Connection accepted in c:\wamp\www\sample.php on line 16
There was a problem

Note: the file contains 7 mb of size.... that full 7 mb being downloaded and still page loading suddenly showing this warning msg and the downloaded file gone....
Post Reply