title: How to get full path to user's type="file" using jQuery Fileupload
body: <p>Im trying to build file preview feature before file being uploaded to the server. </p>
  
  <p>Im stucked with the problem of reading file from the user's computer, not a server</p>
  
  <p>Im usuing <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">jquery Fileupload</a> which fires the file processing on the change function</p>
  
  <pre><code>  return $('#new_order_file').fileupload({
      change: function(e, data) {
          return $.each(data.files, function(index, file) {
              read_file(file);
              console.log(file)
          });
      },
    });
  </code></pre>
  
  <p>Log gives File - name, size, type, <em>proto</em> and LastmodifiedDate</p>
  
  <p>Than, this part is tricky for me, I know that I have to use <code>FileReader()</code> but Im not sure how to</p>
  
  <pre><code>function read_file(f){
      var reader = new FileReader();
      reader.onload = function(e) {
          $('#CO-show-model').css('display', 'block');
          loaded(f.name, e.target.result);
      };
      reader.readAsArrayBuffer(f);
  }
  </code></pre>
  
  <p>Next, loaded function is for displaying the file model using three.js</p>
  
  <pre><code>function loaded(file) {
      var uploaded_file = file // gives 404
      // var uploaded_file = './stl/test-file.stl' // ASCII test
  }
  </code></pre>
  
  <p>The fucntion itself is good, I tested it with an hardcoded path to some test file. But the problem is that it was on a server. Now, script gives an 404 for <a href="http://example.com/filename.stl" rel="nofollow">http://example.com/filename.stl</a> which is true, because I pass <code>file.name</code> there. If I just pass <code>file</code>, it gives 404 for <a href="http://example.com/[object%20File]" rel="nofollow">http://example.com/[object%20File]</a></p>
  
  <p><strong>Edit 1:</strong>
  I tried suggest ReadAsDataUrl, but seems to be that it's not supported by three.js. Also, the FileReader() seems to be ok</p>