In my Laravel application I'm trying to allow the user to upload basic files to a remote FTP and I've been able to create a connection to my FTP through PHP but the moment my code hits the ftp_put() it throws this error.
ftp_put(): Command STOR failed
I've verified that I am able to upload files to my FTP through FileZilla and it does let me do that. Any sort of insight would be awesome.
And below is the code I am using at the moment.
if (Input::hasFile('file')) {
$path = Input::file('file')->getRealPath();
$uploadpath = '/users/';
$usr = 'login';
$pwd = 'password';
// file to move:
$local_file = $path;
$ftp_path = $uploadpath;
// connect to FTP server
$conn_id = ftp_connect('ftp.url.com');
// send access parameters
ftp_login($conn_id, $usr, $pwd);
// turn on passive mode transfers (some servers need this)
ftp_pasv ($conn_id, true);
// perform file upload
ftp_put($conn_id, $ftp_path, $local_file, FTP_ASCII);
ftp_close($conn_id);
}
ftp_put()it sees it can't access root to get further into the directory and throws the error? - Das