I'm trying to use the PHP FTP functions to download a file from my remote server to my local computer. I'm fetching the Test4.txt file on my 'mysite1' remote server and I'm running this code on 'mysite2' remote server.
There are two problems I'm having with the following code:
1. The source file (Test4.txt) is being FTP'd from site1 to site2 but the target file (aaaa.txt) is empty. I don't mind the file being copied over to site2 but I'm wondering why it is empty?
2. From what I have read regarding the FTP PHP functions, the ftp_get function's 2nd argument is called the "local" parameter - I *thought* that would mean local as in my local PC but is that not the case?
PHP Code:
$conn = ftp_connect("ftp.mysite1.com"); if ($conn) { print "connection ok<br>"; ftp_login($conn,"user","pw"); ftp_get($conn,"aaaa.txt","public_html/Test4.txt",FTP_ASCII); } else { print "connection failed<br>"; } ftp_close($conn);
__________________
RalphF
Business Text Messaging Services
Please login or register to view this content. Registration is FREE
|