mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
25 lines
550 B
PHP
25 lines
550 B
PHP
<?php
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Content-Type: application/json');
|
|
$obj = new stdClass();
|
|
$obj->file = tempnam(sys_get_temp_dir(), 'YTPChunk_');
|
|
|
|
$putdata = fopen("php://input", "r");
|
|
$fp = fopen($obj->file, "w");
|
|
|
|
error_log("aVideoEncoderChunk.json.php: start {$obj->file} ");
|
|
|
|
while ($data = fread($putdata, 1024 * 1024)) {
|
|
fwrite($fp, $data);
|
|
}
|
|
|
|
fclose($fp);
|
|
fclose($putdata);
|
|
sleep(1);
|
|
$obj->filesize = filesize($obj->file);
|
|
|
|
$json = json_encode($obj);
|
|
|
|
error_log("aVideoEncoderChunk.json.php: {$json} ");
|
|
|
|
die($json);
|