\n";
echo "
".sprintf($msg["sauv_misc_warning_transfert"],$res->sauv_lieu_nom)."
";
echo "
".$msg["sauv_misc_close_window"]."";
flush();
$tfilecopy=explode("/",$filename);
$filecopy=$tfilecopy[count($tfilecopy)-1];
switch ($res->sauv_lieu_protocol) {
//Si protocol = file
case "file" :
if (!copy($filename,$res->sauv_lieu_url."/".$filecopy)) {
abort("Copy : ".$res->sauv_lieu_nom." : Failed",$logid);
} else {
write_log("Copy : ".$res->sauv_lieu_nom." : Succeed",$logid);
}
break;
//Si protocol = ftp
case "ftp" :
$msg_="";
//Connexion + passage dans le répertoire concerné
$conn_id=connectFtp($res->sauv_lieu_host, $res->sauv_lieu_login, $res->sauv_lieu_password, $res->sauv_lieu_url, $msg_);
if ($conn_id=="") {
abort_copy("Copy : ".$res->sauv_lieu_nom." : Failed : ".$msg_,$logid);
} else {
//Transfert
if (!ftp_put($conn_id, $filecopy, $filename, FTP_BINARY)) {
abort_copy("Copy : ".$res->sauv_lieu_nom." : Failed",$logid);
} else {
write_log("Copy : ".$res->sauv_lieu_nom." : Succeed",$logid);
}
}
break;
}
echo "";
echo "";
?>