N
N
Natasha0002022-01-20 18:16:09
PHP
Natasha000, 2022-01-20 18:16:09

How to send a folder (all files in it) via sftp in php?

Please help me how to implement this (preferably without installing php add-ons (libraries) on the server), since I only have a WordPress site on hosting.
I rummaged through a lot of articles - I did not find a single example of sending a folder (all files in it) via sftp
Through ftp, but not through sftp ...
By "sending a folder (all files in it)" I mean upload.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Ukrainskiy, 2022-01-20
@Natasha000

$connection = ssh2_connect('www.example.ru', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question