How do i connect local directory(on server) to remote directory?

for example, i have 2 servers. one ofs ip 1.1.1.1 and the other ones 2.2.2.2.

i have upload directory on both servers. can i connect first’s upload directory to second one.

copy ("tmp/1.jpg","upload/1.jpg");

this code works on both servers. but i want that, if i run this command on first server, 1.jpg must send to second servers upload directory. is this possible? i googled and found something about virtual directory, ln command. but its not solving my problem.

note: servers are litespeed.

Take a look at this PHP: FTP - Manual

thx for reply.

do i have to change the code? is there any easy way to do this? maybe server module :frowning:

Using FTP is the easy way if you want a copy of the file on both servers.