dened
Guest
проблемы с UPLOAD
Я пытаюсь аплоадить через ФТП, почему то не хочет
вот код:
$ftp_server='213.145.128.8';//serverip
$conn_id = ftp_connect($ftp_server);
$user="user";
$passwd="pass";
$login_result = ftp_login($conn_id, $user, $passwd);
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
die;
}
else
{
echo "Connected to $ftp_server, for user $user";
}
ftp_chdir($conn_id, "/html");
$destination_file=ftp_pwd($conn_id).'/';
$destination_file=$destination_file."x.txt";
$upload = ftp_put($conn_id, $destination_file, $userfile, FTP_BINARY);
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded to $ftp_server as $destination_file";
}
Первая страница выглядит так:
<form enctype="multipart/form-data" action="file-upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
на серваке стоит линух
Я пытаюсь аплоадить через ФТП, почему то не хочет
вот код:
$ftp_server='213.145.128.8';//serverip
$conn_id = ftp_connect($ftp_server);
$user="user";
$passwd="pass";
$login_result = ftp_login($conn_id, $user, $passwd);
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
die;
}
else
{
echo "Connected to $ftp_server, for user $user";
}
ftp_chdir($conn_id, "/html");
$destination_file=ftp_pwd($conn_id).'/';
$destination_file=$destination_file."x.txt";
$upload = ftp_put($conn_id, $destination_file, $userfile, FTP_BINARY);
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded to $ftp_server as $destination_file";
}
Первая страница выглядит так:
<form enctype="multipart/form-data" action="file-upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
на серваке стоит линух