Heres the code I'm using, two days ago it was working fine:
function upload($page,$pageName)
{
//connect to remote host
if(!($this->filetp=ftp_connect($this->ftp->host)))
{
print"ftp error";
die;
}
if(!ftp_login($this->filetp,$this->ftp->login,$this->ftp->password))
{
print'login error<br>';
}
//create a temp. file
if(!$file=fopen("temp".$this->id,"w")) {
print"error creating page $pageName<br>";
die;
}
fputs($file,$page);
fclose($file);
if(!ftp_put($this->filetp,$this->ftp->path."/$pageName","temp".$this->id, FTP_ASCII)) {
print"error putting $pageName<br>";
die;
}
//delete temp file
unlink("temp".$this->id);
//close ftp connection
ftp_quit($this->filetp);
}
It creates the temp file no problems and even creates the file on the server it is uploading to. The Uploaded file is empty though