HTML interesse |
|
Ik heb de volgende code gevonden op php.net maar er komt altijd een foutmelding:
Warning: ftp_chdir(): users.skynet.be/bart_goetschalckx: No such file or directory in /home/aclille/public_html/joggings/ftp_upload_send.php on line 21
kan iemand mij helpen met het oplossen van defout?
<?php
$ftp_server='***.***.***.***';//serverip
$conn_id = ftp_connect($ftp_server);
// login with username and password
$user="login";
$passwd="paswoord";
$login_result = ftp_login($conn_id, $user, $passwd);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
die;
} else {
echo "<br>Connected to $ftp_server, for user $user<br>";
}
ftp_chdir($conn_id, "users.skynet.be/bart_goetschalckx");
ftp_chdir($conn_id, "gein");
// map waarin geupload wordt
//$destination_file=ftp_pwd($conn_id);
$destination_file="x2.jpg";
echo ("<br>");
print $destination_file;
echo ("<br>");
// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, 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_close($conn_id);
?>
<?php $ftp_server='***.***.***.***';//serverip // login with username and password $user="login"; $passwd="paswoord"; $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; } else { echo "<br>Connected to $ftp_server, for user $user<br>"; } ftp_chdir($conn_id, "users.skynet.be/bart_goetschalckx"); // map waarin geupload wordt //$destination_file=ftp_pwd($conn_id); $destination_file="x2.jpg"; // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, 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 ?>
|