I have webcam stream in a Blog object and I need to send it to my backend. I made it:
setInterval(function(){
var blobs=new Blob(that.chunks);
console.log(blobs);//this displays that blobs is full of nnnnn bytes
let form=new FormData();
form.append("blob",blobs);
axios.post("/meet/upload",form).then(resp => {
console.log(resp.data);
that.chunks=[];
}).catch( err => {
console.log("upload fallito: "+err);
that.chunks=[];
});
}, 1000);
this is my console log:
Blob { size: 1743814, type: "" }
Blob is not empty, but in laravel when I'd like to read this data I have empty data:
public function upload(Request $req){
$data=$req->blob;
syslog(LOG_NOTICE,$data);
return response()->json(['len_received' => strlen($data)],200);
}
infact if I do a "sudo tail -f /var/log/syslog" I receive a blank result and in browser console is the same. What is my mistake? Thank you. Bye