I’m having a problem when I try to write a file on my ftp server.
This is the code:
$File = $FileInfo[‘Album_File’];
$Buffer = WHeader($FileInfo);
$ftpCnn = @ftp_connect(FTP_SERVER) or die(“Couldn’t connect to FTP_SERVER”);
$bLogin = @ftp_login($ftpCnn,FTP_USER,FTP_PWD) or die(“Couldn’t login to FTP_SERVER”);
$temp = tmpfile();
if (@ftp_fput($ftpCnn, FTP_ROOT.$File, $temp, FTP_ASCII)) {
$bUpload = TRUE;
} else {
echo “There was a problem while uploading $Filen”;
}
fclose($temp);
@ftp_site($ftpCnn,”CHMOD 0777 “.FTP_ROOT.$File);
$fp = fopen(FTP_ROOT.$File,’w’);
fputs($fp,$Buffer);
fclose($fp);
ftp_close($ftpCnn);
my problem is when I try to fopen the file I get this message:
Warning: fopen(/httpdocs/album.php) [function.fopen]: failed to open stream: No such file or directory .
The file is at the server. wich means that the ftp_fput is working. I think.