PHP function to copy a folder from local machine to NAAS server

SYSTEM INFORMATION
OS type and version W10
Webmin version 2.1

I have this application in php/html that runs on Webmin (e.g. IP Address 01.123.34.45).

In a form, I want the user to insert a local path (e.g. C:\User\Me) and copy all the files in the folder “Me” on a NAAS (e.g. Address //123.456.7.890), creating a new folder to contain these files.

Webmin communicates with the local machine using a SFTP protocol (with user and pwd), and with the NAAS using a SMB protocol.

Maybe is a stupid question but I have absolutely no knowledge on it all, any idea on how to implement it?

At first, when I tested the application in the local machine, I used the php function copy() in a while cycle that iterated until every file on the folder was copied. Once I put the application on the Ubuntu server, since it communicates with the two servers with two different protocols, it blocks when enter the function.

I need to write this copy function in a way that allows the application to copy from a local directory (linked with sftp protocol) and paste in a NAAS (linked with smb protocol).

Webmin has both ssh ans smb modules installed.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.