title: Having freshly recorded audio, post it to server
body: <p>I'm writing an app in Laravel which will convert speech to text.  Currently, the app records audio and if it has audio is already stored on the server side can convert it to text. My problem is getting the audio to the server so it can be converted.  After recording audio the app has a blob encoded as an ogg. How do I go about getting the blob to the server? </p>
  
  <p>Currently, I'm using an ajax request to post the data however, I'm having a hard time accessing the blob on the server side. This is what the ajax looks like:</p>
  
  <pre><code>var fd = new FormData();
  fd.append('fname', 'audioBlob');
  fd.append('data', e.data);
  $.ajax({
      type: 'POST',
      url: '/getSTT',
      data: fd,
      processData: false,
      contentType: false
  }).done(function(data) {
      console.log('returned' + data);
  });
  </code></pre>
  
  <p>In the controller I log the <code>data</code> and it looks like:</p>
  
  <p><code>[2016-12-16 02:12:45] local.INFO: /tmp/php73iL3X</code></p>
  
  <p>When I log the Request object <code>$request-&gt;all()</code> I get: </p>
  
  <pre><code>[2016-12-16 02:12:45] local.INFO: array (
    'fname' =&gt; 'audioBlob',
    'data' =&gt; 
    Illuminate\Http\UploadedFile::__set_state(array(
       'test' =&gt; false,
       'originalName' =&gt; 'blob',
       'mimeType' =&gt; 'audio/ogg',
       'size' =&gt; 4751,
       'error' =&gt; 0,
    )
  </code></pre>
  
  <p>),
  )</p>
  
  <p>Is there a step that I'm missing?</p>
  
  <p>Perhaps a better way to do all this?</p>