Click here to Skip to main content
14,699,570 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to convert video blob url into base64 using php.

My blob url like this
blob:https://localhost/f4d27a7d-48f1-4499-9613-7953ef01edfe
this I need to convet base64 like
data:video/webm;codecs=vp8;base64,.........
.

This blob url I have converted into base64 by using javascript but I have to do in PHP only

Here is my javascript code what ever I have done
var reader = new FileReader();
 reader.readAsDataURL(recorder.getBlob());
 reader.onloadend = function() {
     var base64data = reader.result;
    console.log(base64data);


In console I got base64 url perfect ,but I have to do in PHP only.

This blob url in php I stored in variable called $blob
$blob =blob:https://localhost/f4d27a7d-48f1-4499-9613-7953ef01edfe


Can any one help me in this one .

Thanks

What I have tried:

var reader = new FileReader();
 reader.readAsDataURL(recorder.getBlob());
 reader.onloadend = function() {
     var base64data = reader.result;
    console.log(base64data);
Posted
Updated 10-Sep-20 23:15pm

Doesn't look like you even attempted a (PHP) base64_encode.

PHP: base64_encode - Manual[^]
   
The URL lifetime is tied to the document in the window on which it was created.
You cannot access a blob: URL from the server. You can only access it via Javascript.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900