I am trying to download a file from a website to my local computer using FTP. ( Ultimately I would like to download several files but can't past this basic step. )
The web server is running UNIX. I am able to log in to the FTP server successfully with code not included here using a special FTP account I have created for this purpose. Currently this account has permission '0755' set for the server directories used in the code.
When I use ftp_get or ftp_fget the following warnings are returned and no file transfer occurs:
Warning: ftp_fget() [function.ftp-fget]: bind() failed: Permission denied (13) in <php file line ..>
Warning: ftp_fget() [function.ftp-fget]: Type set to I in <php file line ..>
In the code included below $ftp seems to be a valid connection handle since login using it succeeds. I have tried this both with and without having created the local directory for the downloaded file ( ie. c:\pg09\ ) and using two variants of the remote server path to the file I want to download. These are
g" ( this is the full path to the file on the server )
"./Images/46/46_1.jpg" ( this is the path that the logged on user is restricted to on the server )
The local machine is a PC running WinXP Pro SP3. I have set NTFS permissions on the local folder "c:\pg09" to Modify for Everyone. This did not change the result.
Please help me understand how to resolve this.
Thanks for your help.
ftp_get( $ftp, "c:\pg09\46_1.jpg", ".grads/images/46/46_1.jpg", FTP_BINARY );