troubleshooting Question

Warning: ftp_put() [function.ftp-put]: Rename/move failure: No such file or directory

Avatar of MuhammadAdil
MuhammadAdilFlag for Pakistan asked on
PHPServer SoftwareNetworking Protocols
5 Comments1 Solution5688 ViewsLast Modified:
Question:
here is my code

PHP Code:
<?php
// set up basic connection

$ftp_server = "server.com";
$ftp_user_name = "username";
$ftp_user_pass = "userpass";
$destination_file =
$source_file = "E:/My Web/Project/temp/project.zip";
$destination_file = "/home/{username}/public_html/project.zip";

$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 $ftp_user_name";
        exit;
    } else {
        echo "Connected to $ftp_server, for user $ftp_user_name";
    }

// 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);
?>

this code is taken from http://php.net/ftp
i am getting this error
HTML Code:

Warning: ftp_put() [function.ftp-put]: Rename/move failure: No such file or directory


what i m doing wrong
ASKER CERTIFIED SOLUTION
Computer101

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros