#!/usr/bin/php # Usage example: matrix_cp /tmp/test.jpg glasgow # this will send the test.jpg to the glasgow room # this also supports remote URLs $msgtype, "body"=>$alt_text, "url"=>$mxc_url)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); $response = curl_exec($ch); // SUCCESS. No output. } else { echo "Error uploading $filename. "; echo implode(" : ", $response_json)."\n"; }