The error I have been getting is either (when I switch the $_FILES['uploadfile']['name'] (originally at top where tmp_name is)
Warning:ftp_put (C:\Inetpub/vhosts/dumountaineer.c om/httpdocs/dbimage/log.gif) [function.ftp-put]: failed to open stream: No such file or directory in C:\Inetpub\vhos ts\dumountainee r.com\httpdocs\ todb.php on line 21
or Access Denied when I switch back.
Warning:ftp_put (C:\Inetpub/vhosts/dumountaineer.c om/httpdocs/dbimage/log.gif) [function.ftp-put]: failed to open stream: No such file or directory in C:\Inetpub\vhos ts\dumountainee r.com\httpdocs\ todb.php on line 21
or Access Denied when I switch back.
Code:
<?php
$tmp=$_FILES['uploadfile']['tmp_name'];
$password="pass"; //not real of course
$user="user"; //not real of course
$server="localhost";
$connection=ftp_connect($server);
$login=ftp_login($connection,$user,$password);
if($login)
{
//it says it connected and says Attempting to Load: thefile.something
echo "Connected";
echo "Attempting to Load:";
echo $tmp;
}
else if (!$login)
{
echo "Could not Establish Connection <br />";
}
$directory="C:\Inetpub/vhosts/dumountaineer.com/httpdocs/dbimage/".$_FILES['uploadfile']['name']; //any way i do this it fails to upload
if(ftp_put($connection,$tmp,$directory,FTP_BINARY)){
echo "Thanks! Succesful Upload";
}
else
{
echo "Failed Upload";
}
ftp_close($connection);
?>
Comment