Warning: ftp_fput() expects parameter 3 to be resource, string given in c:\webserver\apache\htdocs\ftp.php on line 27
wer kann mir da helfen, alle rechte sind in ordnung, alles funtzt, aber er will das file nicht kopieren!
PHP-Code:
<?php
$destination_file = "test3.txt";
$fp = "http://192.168.0.4/test.txt";
$ftp_server = "192.168.0.4";
$ftp_user_name = "lilo";
$ftp_user_pass = "lilo";
// set up basic connection
$conn_id = ftp_connect("$ftp_server");
// login with username and password
$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "Ftp connection has failed!";
echo "Attempted to connect to $ftp_server for user $user";
die;
} else {
echo "Connected to $ftp_server, for user $user";
}
// upload the file
$upload = ftp_fput($conn_id, "$destination_file", "$fp", FTP_BINARY);
// check upload status
if (!$upload) {
echo "Ftp upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
// close the FTP stream
ftp_quit($conn_id);
?>
Kommentar