Im Just create php ftp that allways to upload a single file by this script :
<?
#
$ftp_server = "ftp.dddddd.com";
$ftp_user_name = "timun";
$ftp_user_pass = "tumin";
#
$conn_id = ftp_connect($ftp_server,21);
$login_result = ftp_login( $conn_id, $ftp_user_name, $ftp_user_pass );
$destination_file = "ss.sql";
$source_file = "c:/wisenut.txt";
#
if(!is_file($source_file)) { die("That file ".$source_file." doesn't exist... at least not in that location."); }
if(!is_readable($source_file)) { die("You do not have permissions to read/access this file."); }
if(filesize($source_file) > 0) {
echo "Everything checks out. The file exists, is readable, and has " . filesize($source_file) . " bytes of data.";
} else {
echo "That file has no data!";
}
#
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name<BR>";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name<BR>";
}
// check directory
$upload = ftp_chdir($conn_id, "/public_html/dump/" );
if ( $upload ){
echo "change directory to /public/dump/<br>";
} else {
echo "change directory failed!<br>";
}
// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII);
// check upload status
if (!$upload) {
echo "FTP upload has failed!<BR>";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file<BR>";
}
// close the FTP stream
ftp_close($conn_id);
?>
but im always find a message "That file c:/wisenut.txt doesn't exist... at least not in that location."
im already change source file with c:\wisenut.txt, c:\wisenut.txt and c://wisenut.txt but but nothing changes.
Im use windows 2000SP4 and my hosting use PHP 4.3.4
Whats Wrong with this, whats wrong with me, help me please
Note : i dont to use ftp_put not upload within form.