javascrit
function saveVideo(b) {
var f = new FormData();
f.append('videofile', b);
var xhr=new XMLHttpRequest();
xhr.open('POST','save.php');
xhr.send(f);
}
php
<?php
if($_FILES['videofile']){
$my_file = $_FILES['videofile'];
$my_blob = file_get_contents($my_file['tmp_name']);
file_put_contents(mktime() . '.webm', $my_blob);
}
?>
I record a video in video/webm format via MediaRecorder and pass the blob to the saveVideo function, which in turn makes a POST request to the file save.php , but he responds with the code 500
source https://stackoverflow.com/questions/76502031/how-to-record-a-video-to-a-web-file-using-php
No comments:
Post a Comment