Hello wise and merciful PHP elders. I'm attempting to setup/learn how to use FTP with php. I've written the following script.
<?php
$resource = ftp_connect('hidden');
$login = ftp_login($resource, 'hidden', 'hidden');
if($login){
printf("We are now connected");
}else{
printf("Connection faild");
}
$list = ftp_rawlist($resource, '/idx', true);
if (ftp_get($resource, '/var/www/downloads', '/IDX/features.txt.gz', FTP_BINARY)){
printf("...Files downloaded correctly");
}else{
printf("...Files not downloaded correctly");
}
?>
In this script I'm attempting to download a file from the directory I know exists. The script logs in successfully and tells me "We are now connected...Files downloaded correctly", But there's no files in the directory and none appear to be downloaded. I told it to download a specific file that I know is inside there because I didn't know how to tell it to download all the files. When I change the downloads folder to a text file called download.txt the result is the same.
I best guess is it has some thing to do with the files being .text.gz or perhaps I've it's some thing to do with the localhost downloads directory.
Any help any of you could provide would be greatly appreciated.
Thank you for your time.