I need to send a file from one PHP page (to which the client uploads files) to another PHP page on another server, the files will be permanently saved.
To contact us, I use the JSON-RPC protocol; Is it wise to send the file this way?
$string = file_get_contents("uploaded_file_path");
send the string to the remote server and then
file_put_contents("file_name", $recieved_string_from_remte);
I understand that this approach takes twice as much time as downloading directly to the second server.
thanks
[edit]
Details:
I need to write a service that allows a php user (maybe joomla) to use a simple api to upload files and send other data to my server, which analyze them, put them in db and send a response
[change]
I need to create a simple method that allows the end user to do this, who will use this interface on server 1 (upload), using php and stopping, so the remote ssh mounts strange funny things
source share