Upload file with php to another php server

后端 未结 3 1525
自闭症患者
自闭症患者 2020-12-07 15:48

I\'m not asking about uploading a file from a browser to a php script, there\'s plenty of tutorials about that already. I\'m asking about this:

I have a php script t

3条回答
  •  误落风尘
    2020-12-07 16:36

    You could use SOAP to send the file from one server to the other.

    Receiving server:

    'somerui') );
    $server->addFunction( 'receiveFile' );
    function receiveFile( $file ) {
       file_put_contents( 'somepath', base64_decode( $file ) );
    }
    ?>
    

    Sending server:

    'somerui') );
    $client->receiveFile( base64_encode( file_get_contents( 'somepath' ) );
    ?>
    

提交回复
热议问题