Reputation: 15
I am developing some mobile web app which consists of html5, javascript and css.
Now I want to implement image upload function which accepts only their camera not their file storage.
Generally, input type="file"
element accepts both files from their file storage and their camera app, or only their storage.
Now I want to restrict to select file image which has already saved. Accepts only picture which has just taken their camera now.
Is it possible this in mobile web app using by html/JS
It is also ok not to use input type="file"
tag, if there are good solution, I appreciate to share to me.
Thanks in advance.
<input type="file" multiple="true" accept="image/*" style="" class="" >
Upvotes: 1
Views: 1524
Reputation: 3205
Try adding capture="camera"
attribute and see if this is what you want.
<input type="file" accept="image/*" capture="camera">
Note that the files selecting is still allowed on desktop browsers.
Upvotes: 2