dqy0707
2013-05-07 14:36 阅读 109

如何在php中获取blob数据?

Blob is sound blob data.

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);
});

How to get "data" in upload.php?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    donkey111111 donkey111111 2013-05-07 14:44
    <?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
    
    点赞 评论 复制链接分享

相关推荐