By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

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

P: 10
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
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
In Chrome (for testing), when I try to
$("#f_capture").val() evaluates to C:\fakepath\photo.JPG"
looks like itís 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.