title: Pass Blob through ajax to generate a file
body: <p>I'm trying to capture audiorecorder (<a href="https://github.com/cwilso/AudioRecorder" rel="noreferrer">https://github.com/cwilso/AudioRecorder</a>) and send the blob through Ajax a php file, which will receive the blob content and create the file(the wave file in this case).</p>
  
  <p>Ajax call:</p>
  
  <pre><code>audioRecorder.exportWAV(function(blob) {
        var url = (window.URL || window.webkitURL).createObjectURL(blob);
        console.log(url);
        var filename = &lt;?php echo $filename;?&gt;;
        $.ajaxFileUpload({
          url :  "lib/vocal_render.php",
          secureuri      :false,
          dataType : blob.type,
          data: blob,
          success: function(data, status) {
            if(data.status != 'error')
              alert("boa!");
          }
        });
      }); 
  </code></pre>
  
  <p>and my php file (vocal_render.php):</p>
  
  <pre><code>&lt;?php 
  
  if(!empty($_POST)){
      $data = implode($_POST); //transforms the char array with the blob url to a string
      $fname = "11" . ".wav";
  
      $file = fopen("../ext/wav/testes/" .$fname, 'w');
      fwrite($file, $data);
      fclose($file);
  }?&gt;
  </code></pre>
  
  <p>P.S:I'm newbie with blobs and ajax.
  Thanks in advance.</p>