Hi Fellows,
I am having trouble sending a file to SFTP and error coming in line 14
Warning: ssh2_scp_send(): Failure creating remote file: (null) in path on line 14
fyi, i have read write permissions to that sftp folder
<?php
$server = 'sftp.my.com';
$port = '22';
$username = 'myLogin';
$passwd = 'Pa$$w0rd';
$localFile = '000001.txt';
$connection = ssh2_connect($server, $port);
if (ssh2_auth_password($connection, $username, $passwd)) {
echo "Connection successful, uploading file now...</br>";
$sftp = ssh2_sftp($connection);
$sftp = ssh2_scp_send($connection, "000001.txt", "/upload/".$localFile, 0644);
if($sftp){
echo"<h1>Success</h1>";
return ":)";
}