Ik zie het niet meer ik heb een fout in php ftp_put om een file te uploaden naar de ftp server.
- Inloggen gaat goed
- Dir listings gaan goed
- ftp_get gaat goed
ftp_put niet
mijn code is alsvolgt:
if ($_GET['act'] =="edit" && $_GET['save'] !=null) {
//$destination_file = $row_rsdt_Account['server_root'].'/'.$row_rsdt_Account['server_start'] .'/'. $_SESSION['prevfile'];
$destination_file = $_SESSION['prevfile'];
$source_file = $_SERVER['DOCUMENT_ROOT'].'/_cms_temp/temp.tmp';
//print "des". $destination_file;
//print "source ". $source_file;
//exit;
print "hier:". ftp_pwd($ftp);
ftp_chdir ( $ftp,'../' );
ftp_chdir ( $ftp,$row_rsdt_Account['server_root']);
print "hier:". ftp_pwd($ftp);
ftp_chdir ( $ftp,$row_rsdt_Account['server_start']);
print "hier:". ftp_pwd($ftp);
$upload = ftp_put($ftp, $destination_file, $source_file, FTP_ASCII,0);
// controleer de upload status
if (!$upload) {
echo "FTP upload is mislukt!";
} else {
echo "Geupload: $source_file naar $ftp_server als $destination_file";
}
}