$ftp_server="ftp.ehotelmanagement.com";
$ftp_user_name="pranay@ehotelmanagement.com";
$ftp_user_pass="Smart@#pt01";
$file = public_path('robots.txt');//tobe uploaded
$remote_file = "/test-file/test.txt";

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
try {
  $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
  ftp_pasv($conn_id, true);
} catch (\Exception $e) {
  dd($e->getMessage());
}
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
   echo "successfully uploaded $file\n";
   exit;
} else {
   echo "There was a problem while uploading $file\n";
   exit;
   }
// close the connection
ftp_close($conn_id);
