On elearning-server1, your receiving code e.g. Alternatively you could open and read the file - which I don't go into here. The hard part above may be catching the upload event in Drupal and accessing the upload file information. It will copy the files between the machines, as well as preserve both permissions and user/group ownerships. This command will likely do what you want. So every time some event of your choice happens on drupal-server2, you run the code which uploads a file to a php script - something like this: $remote_url = "" Ĭurl_setopt($ch, CURLOPT_URL, $remote_url) Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, true) Ĭurl_setopt($ch, CURLOPT_POSTFIELDS, $data) One of the best advantages of using SCP command-line utility is that it does not require any login to a server to transfer files between two remote systems. However, since rsync will do multiple analysis passes on each file, and then copy the changes, it is much slower than tar for the initial copy. You should check out PHP documentation on uploading files via POST:Īlso check out curl_setopt(), especially " Example #2 Uploading File": IMO a simpler/safer and timely approach - assuming you have access to the destination server and can add some code there that runs under its respective web server - is to use some curl php code on the "client" (server 2 - drupal) and some php code on the "server" (server 1 - elearning) to receive the file and store it appropriately.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |