1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/objects/aVideoEncoderChunk.json.php
2022-03-17 11:43:59 -03:00

25 lines
575 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);