title: BLOB URL to file with PHP
body: <p>I'm trying to create a file preview system.</p>
  
  <p>When the user click in a upload button and select files, I use the HTML5 FILE API to get all the file info and create a thumbnail for the file.</p>
  
  <p>The user can cancel the upload of some of thoose files and add more files too.</p>
  
  <p>What I have now is this:</p>
  
  <pre><code>&lt;p&gt;&lt;input id="blob" name="blob" type="file" size="75" multiple /&gt;&lt;/p&gt;
  &lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
  &lt;input id="blobtype" name="blobtype" type="text" size="20" /&gt;
  &lt;input id="bloburl" name="bloburl" type="text" size="50" /&gt;
  &lt;input id="salvar" name="salvar" type="submit" value="salvar" /&gt;
  &lt;/form&gt;
  &lt;p id="result"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>And my javascript:</p>
  
  <pre><code>function cbu(file)
  {
  if (window.URL){ return window.URL.createObjectURL(file);}
  else if (window.webkitURL){ return window.webkitURL.createObjectURL(file);}
  else if (window.createObjectURL){ return window.createObjectURL(file);}
  else if (window.createBlobURL){ return window.createBlobURL(file); }
  }
  
  document.getElementById("blob").onchange = function(event)
  {
  var result = document.getElementById("result");
  var i = 0, j = event.target.files.length;
  for (i = 0; i &lt; j; i++)
  {
      var url = cbu(event.target.files[i]);
      var img = document.createElement("img");
      img.onload = function(){ }
      result.appendChild(img);
      img.src = url;
      document.getElementById("blobtype").value = event.target.files[i].type;
      document.getElementById("bloburl").value = url;
      }
  };
  </code></pre>
  
  <p>It genarate a thumbnail like this:</p>
  
  <pre><code>&lt;img src="blob:b9a8e310-05b3-48ba-ba24-9ca7cf287f71"&gt;
  </code></pre>
  
  <p>This value <code>blob:b9a8e310-05b3-48ba-ba24-9ca7cf287f71</code> is send to a PHP file when user submit the form.</p>
  
  <p>So my question is, how can I transform this blob url into a file so I can save it in my app?</p>
  
  <p>There is a better way of doing this?</p>
  
  <p>Thank for your help!</p>