rgb192
asked on
ftp copy file to localhost
i have successfully connected
there is one file in one folder
want to copy that file to localhost
php_rawlist only shows filenames
there is one file in one folder
want to copy that file to localhost
<?php
error_reporting(E_ALL);
$host='';
$user='';
$password='';
//Connect to the FTP server
$ftpstream = ftp_connect($host);
//Login to the FTP server
$login = ftp_login($ftpstream, $user, $password);
if($login) {
//We are now connected to FTP server.
echo 'connected';
}else{
echo 'what happened';
}
//Close FTP connection
ftp_close($ftpstream);
php_rawlist only shows filenames
You can very well use, ftp_get() function to download the files, ref. http://php.net/manual/en/function.ftp-get.php
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
I have a related question
I do not know filename
https://www.experts-exchange.com/questions/27873027/ftp-copy-file-to-localhost-do-not-know-file-name.html
I have a related question
I do not know filename
https://www.experts-exchange.com/questions/27873027/ftp-copy-file-to-localhost-do-not-know-file-name.html