Geek4;11064793 wrote:It is at the root level...hope image will help
If you're in a Jail, a Docker container, or any type of CHROOTed environment, your "root" might not be the same as PHP's.
Have you tried omitting the beginning slash?
$sftp = ssh2_scp_send($connection, "000001.txt", "upload/".$localFile, 0644);
Alternatively, try the "curdir" placeholder:
$sftp = ssh2_scp_send($connection, "000001.txt", "./upload/".$localFile, 0644);
As a matter of fact is MAY be possible that your version of PHP needs the absolute path on the remote system, so you can (probably should) use [man]ssh2_sftp_realpath/man to determine the real path. I've seen some references that seem to suggest you must use real paths with ssh2_scp_send()....