It looks like you're new here. If you want to get involved, click one of these buttons!
$ftp_user_name="login";
$ftp_user_pass="password";
$source_file="C:\Documents and Settings\NAME\Bureau\SERVER-2nd5778.pdf";
$destination_file="/FOLDER1/FOLDER2/FOLDER3/SERVER-2nd5778.pdf";
$conn_id = ftp_connect("ftp.sitename.fr");
$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
if ((!$conn_id) || (!$login_result)) {
echo "La connexion FTP a échoué!";
echo "Tentative de connexion à $ftp_server avec $ftp_user_name";
die;
} else {
echo "$ftp_user_name";
}
$upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY);
if (!$upload) {
echo "Le téléchargement Ftp a échoué!";
} else {
echo "Téléchargement de $source_file - $destination_file";
}
ftp_quit($conn_id);
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
}
echo "1";
if (!empty($_FILES)) {
$ftp_user_name="login";
$ftp_user_pass="password";
$source_file="C:\Documents and Settings\NAME\Bureau\SERVER-2nd5778.pdf";
$destination_file="/FOLDER1/FOLDER2/FOLDER3/SERVER-2nd5778.pdf";
$conn_id = ftp_connect("ftp.sitename.fr");
$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
if ((!$conn_id) || (!$login_result)) {
echo "La connexion FTP a échoué!";
echo "Tentative de connexion à $ftp_server avec $ftp_user_name";
die;
} else {
echo "$ftp_user_name";
}
$upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY);
if (!$upload) {
echo "Le téléchargement Ftp a échoué!";
} else {
echo "Téléchargement de $source_file - $destination_file";
}
ftp_quit($conn_id);
echo "1";