I keep getting errors when I try to use the ftp_put command. I have FTP enabled in PHP and I made sure that path names are correct.
$server=ftp_connect("XXX.XXX.XXX.XXX",21);
if($server==false)
{
header("Location: login.php?error=1");
}
else
{
$uid="test";
$pwd="*******";
$result=ftp_login($server,$uid,$pwd);
if($result==false)
{
header("Location: login.php?error=2");
}
else
{
$to="/var/httpd/htdocs/php/example/images/image.gif";
$from="H:\temp\image.gif";
ftp_put($server,$to,$from,FTP_BINARY);
ftp_quit($server);
}
}
The error is produces is:
Warning: ftp_put(): error opening /var/httpd/htdocs/php/example/images/image.gif in /export/space0/apache/httpd/htdocs/php/save.php on line 58