title: PHP display chosen image before upload
body: <p>I'm using Codeigniter's upload library to upload images for user avatars. I'm also using <a href="http://deepliquid.com/content/Jcrop_Manual.html#Introduction" rel="nofollow noreferrer">Jcrop</a> which allows users to select an area to crop. </p>
  
  <p><a href="https://i.stack.imgur.com/xBEBI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xBEBI.jpg" alt="enter image description here"></a><br>
  <sub>(source: <a href="http://www.webresourcesource.com/wp-content/uploads/2012/04/jcrop.jpg" rel="nofollow noreferrer">webresourcesource.com</a>)</sub>  </p>
  
  <p>I'm saving all the coordinates of the selected area in text inputs which I'll use in php to crop. </p>
  
  <p>Is it possible to display the image selected before uploading?</p>
  
  <p>Upload form:</p>
  
  <pre><code>&lt;?php echo form_open_multipart('upload/do_upload');?&gt;
  
  &lt;input type="file" name="userfile" size="20" /&gt;
  
  &lt;input type="submit" value="upload" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>If possible I'm trying to avoid heavy js for this or uploading 2 times. When choosing a file I notice that it shows the name of it:</p>
  
  <p><img src="https://i.stack.imgur.com/x0Gpy.jpg" alt="enter image description here"></p>
  
  <p>Is there a way to use that functionality to retrieve the image path as well (path to the image in the uploader's computer)? In theory I'll be able to use that in image tags and display the image without js.  </p>