note 20064 added to function.ftp-put
| From: | ahk_arup at hotmail dot com | Date: | Thu, 21 Mar 2002 03:28:42 +0000 |
| Subject: | note 20064 added to function.ftp-put | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28018@lists.php.net to get a copy of this message | ||
It's not working. Help me out!
Everytime I got the message "File can't open"
Here is my code:
<?php
$conn_id = ftp_connect("$ftp_server");
$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
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 "Connected to $ftp_server, for user $ftp_user_name";
}
$destination file="/home/www/myname"
$source file="C:/windows/desktop/filename.doc";
$upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY);
if (!$upload) {
echo "Ftp upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
ftp_quit($conn_id);
?>
--
http://www.php.net/manual/en/function.ftp-put.php
http://master.php.net/manage/user-notes.php?action=edit+20064
http://master.php.net/manage/user-notes.php?action=delete+20064
http://master.php.net/manage/user-notes.php?action=reject+20064