$host="***********************"; $user="***********************"; $password="***********************"; $local_file = $_FILES['file']['tmp_name']; # локальный файл $remote_file = preg_replace("~.*/([^/]*)~m","\\1",$_FILES['file']['name']); $connect = ftp_connect($host); if (!$connect){ echo "Ошибка в подклчение!"; }else{ $result = ftp_login($connect, $user, $password); if (!$result){ echo "Ошибка"; }else{ //ftp_chdir($connect, $dir); ftp_cdup($connect); if (ftp_put($connect, $remote_file, $local_file, FTP_BINARY)){ echo "Загружен"; }else{ echo "Не загружен"; } } } echo '
'.$_FILES['file']['tmp_name'].'