Reputation: 5800
this is frustrating... I keep getting an error with my ftp_put:
This the error: No such file or directory in /Users/xxxx/Documents/Work/something
Is there any glaring errors in my code I'm blind to?
$server = "79.170.40.xxx";
$connection = ftp_connect($server);
$login = ftp_login($connection, "xxx.xxx.co.uk", "xxx");
if (!$connection || !$login) { die('Connection attempt failed!'); }
$upload = ftp_put($connection, '/home/sites/xxx.xxx.co.uk/public_html/dev/uploads/training/powerpoints/' . $filename, $details['tmp_name'], FTP_ASCII);
if (!$upload) { echo 'FTP upload failed!'; }
ftp_close($connection);
Cheers.
Upvotes: 1
Views: 1875
Reputation: 124768
To me, it would appear that you're trying to upload a file that doesn't exist in the server (in this case it seems that you're doing this locally, so the file doesn't exist on your machine).
Where does $details['tmp_name']
come from, and are you sure it is a valid path and file?
Upvotes: 1
Reputation: 5473
Make sure you are using the right syntax. ftp_put() accepts remote file first and then local file. What is $details in the code?
--Pinaki
Upvotes: 0