2

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中获取“数据”?

4

1 回答 1

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
于 2013-05-07T14:44:59.767 回答