469,307 Members | 2,211 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

HTML5 - Copying image taken from <input> to <img>

Hi,
I am trying to take a photo using HTML5 input field, and need to move it to a img tag as below:

Expand|Select|Wrap|Line Numbers
  1. <p>Capture Image: <input type="file" accept="image/*" id="f_capture" capture="camera"/> </p>
  2.  
  3. <img id="imageholder" src="" />
In Chrome (for testing), when I try to
$("#f_capture").val() evaluates to C:\fakepath\photo.JPG"

I am not sure how to extract the value from the input field like I would normally do with ordinary <input> items.

Any help appreciated. Thanks.
Jun 3 '14 #1
1 1467
Dormilich
8,651 Expert Mod 8TB
In Chrome (for testing), when I try to
$("#f_capture").val() evaluates to C:\fakepath\photo.JPG"
looks like its working

anyways, file inputs implementing the File API can be used as:
Expand|Select|Wrap|Line Numbers
  1. var fileName = document.getElementById('f_capture').files[0].name;
Jun 3 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Andreas Viklund via DotNetMonster.com | last post: by
7 posts views Thread by David Stone | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.