Blob是声音blob数据。
var fd = new FormData();
fd.append('fname', 'test.wav');
fd.append('data', blob);
$.ajax({
type: 'POST',
url: 'upload.php',
data: fd,
processData: false,
contentType: false
}).done(function(data) {
console.log(data);
});
如何在upload.php中获取“数据”?
答案 0 :(得分:0)
<?php
//lets assume you are uploading an .jpg image
$filename = 'image.jpg';//<-- your filename and extension
file_put_contents($filename, $_POST['data']);
//now you have image.jpg