Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

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
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);

Open in new window



php_rawlist only shows filenames
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

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
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER