Page 1 of 1

ftp_get issues

Posted: Fri Jun 13, 2003 12:04 pm
by daven
I am attempting to use ftp_get to download a file from the server to the client machine (in this case a Windows box). Regardless of what I do, I receive the following error message when I use the function:

"Warning: ftp_get() [function.ftp-get]: Error opening $localfile in $script on line 7". ie--I cannot create the local file, nor can I open it if it already exists.

code snippet is as follows:

Code: Select all

<?php
$local="c:\\file.jpg"; // I have tried with absolute paths, relative paths, etc.
$remote="/path/to/file.jpg"; 

$ftp_conn=ftp_ssl_connect($host) or die('connection failed');
@ftp_login($ftp_conn,$username,$password);
ftp_get($ftp_conn,$local,$remote,FTP_BINARY);
?>
I can (and do) use ftp_put without error. From the error message, it seems like a permissions problem, but I have tried it on various clients with various settings and it never changes.