So i have a page set up that needs to send a blob variable to a php page. The php page then uploads the blob to mysql using pdo. I have the ajax set up so it sends just a text variable and uploads it just fine. However when I try to do a blob it will not work.
Main page
var blob = new Blob(["i am a blob"]);
$.ajax({
type: 'POST',
url: 'test.php',
data: {roll: blob},
});
Php page
$got = $_POST['roll']; //gets the variable
$pdo = new PDO('mysql:host='. $host .';dbname='.$db_name, $db_username, $db_password);
$query = $pdo->prepare('INSERT INTO books (test,rec) VALUES (?,?)');
$query->bindValue(1, '35');
$query->bindValue(2, $rollv);
$query->execute();