Show sourcecode
The following files exists in this folder. Click to view.
Webserver1/Ovningar/Slutprojekt/DEBUG/
callback_log.txt
ffmpeg_testing.php
force_verify_timeout.php
phpinfo.php
reset_session.php
test_callback_recieve.php
test_callback_send.php
test_dbmanager.php
test_upload.php
uploads/
test_callback_recieve.php
32 lines ASCII Windows (CRLF)
<?php
try {
// show all error reporting
error_reporting(-1); // Report all type of errors
ini_set('display_errors', 1); // Display all errors
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
$media = $_FILES["media"] ?? null;
$callback_url = $_POST["callback_url"] ?? null;
file_put_contents("callback_log.txt", "File recieved: " . $media["name"], FILE_APPEND);
$json_str = '{
"status": "success",
"request": {
"id": "req_' . uniqid() . '",
"timestamp": "' . time() . '"
},
"media": {
"id": "med_' . uniqid() . '",
"uri": "' . $media["name"] . '"
},
"callback": "' . $callback_url . '"
}';
echo $json_str;
} catch (Exception $e) {
echo false;
http_response_code(500);
}
http_response_code(200);
?>