12

Background: iOS 6.1, at the time of writing, doesn't allow both multiple file selection and taking a photo in a single input.

Since my main app already has a multiple input picker for choosing files, I'd like to add a second button (only required by, and only shown on) iOS devices to start the camera.

This currently works with:

<input type="file" class="ios_only" accept="image/*;capture=camera">

However iOS Safari always gives the following dialog:

iOS 'take photo' or 'choose exiting' dialog

Is there a way the <input> can be made to go directly to the camera without this prompt?

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • Related: http://stackoverflow.com/questions/6336641/html5-camera-access-through-browser-in-ios – GlennG Aug 21 '15 at 09:15

2 Answers2

12

No, you can't. Safari handles this as an UIImagePickerView and has to choose the source by this UIActionSheet.

For your information, this line has the same effect:

<input type="file" class="ios_only" accept="image/*" capture="camera">

Tested also in iOS 7.

Raptor
  • 53,206
  • 45
  • 230
  • 366
3

For multiple file uploads:

<input capture="camera" accept="image/*" multiple="multiple" type="file" name="photo" id="photo" value="" />
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
josdev
  • 81
  • 1
  • 11