I want to create an application server that serves html content which contains links to static images served by another server on a different domain. The images are uploaded by
Mostly depends on what you can use.
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
PHP manual here: function.ssh2-scp-send.php
$file = 'somefile.txt';
$remote_file = 'readme.txt';
// set up basic connection
$conn_id = ftp_connect("ftp.example.com");
// login with username and password
$login_result = ftp_login($conn_id, "username", "password");
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection
ftp_close($conn_id);
PHP manual here: function.ftp-put.php
This is more like real web browser behavior as seen by another server:
You can use socket_connect();
and socket_write();
, I will add more information about those later.