I can't download a file from the FTP server to my local computer. I keep on getting false from ftp_get
// define variables
$folder_path = "Applications/MAMP/htdocs/infoscreen/PVdata";
$local_file = fopen ("newpv.csv",'w');
$server_file = "tlxesb@pv-systems.dk-171206100007";
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// turn passive mode on
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_BINARY)) {
echo "Successfully written to $local_file
";
} else {
echo "There was a problem
";
}
// close the connection
ftp_close($conn_id);