![]() ![]() 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. There are multiple methods you can use to securely copy files between Linux hosts. 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) 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 |