Skip to Content
Platform.Ontology

Capture attribute (camera or mic from a file input)

Opens the phone camera or microphone directly from a file input; the page gets one finished file.

You pick what to shareFiles and storageFilesWeb browsersWhile you use it

In one line

Can open your camera or microphone app for one photo, video or clip

Opens the phone camera or microphone directly from a file input; the page gets one finished file.

A site can skip the gallery and ask for a fresh photo, video or recording. It gets a single file, not a live stream, and the person confirms each capture.

What it can and can't do

What the user does: You tap Take photo, Scan document or Record video on an upload button.

It can

  • Start the phone's camera app straight from an upload button
  • Receive the one finished file
  • Ask for the front or back camera

It cannot

  • Watch live camera video
  • Take extra pictures after the first
  • See your photo library, only the one new picture
  • Work on computers, which show a normal file chooser

How it differs between platforms: Works on iPhone and Android phones. Desktop browsers ignore it and show the usual file chooser.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeNot supportedNot availableNot listedDesktop falls back to the file chooser
EdgeNot supportedNot availableNot listedDesktop falls back to the file chooser
FirefoxNot supportedNot availableNot listedDesktop falls back to the file chooser
SafariNot supportedNot availableNot listedDesktop falls back to the file chooser
Safari on iPhoneSupported102016-09-13All iOS browsers use WebKit
Chrome on AndroidSupported252013-02-27None
Samsung InternetSupported1.52013-09-25None

How a site asks for it

API<input type=file accept="image/*" capture="environment">; capture=user
Browser compat keyshtml.elements.input.capture
api.HTMLInputElement.capture
How access is grantedpicker
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureYes
Activationtransient
How long it lastsPer capture
How to take it backNothing to revoke (no permission is stored)
Inside an iframeWorks in any frame

Typical flow

  1. Person taps the input
  2. Camera or voice recorder app opens
  3. Person captures and confirms; File returns to the page

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • Mobile only effect: desktop browsers fall back to the file chooser
  • Values user (front camera) or environment (rear camera); the app may let the person switch
  • Result is a single file; the page cannot stream or preview before the capture ends
  • Combined with accept=image/*, video/* or audio/* to choose the capture type
  • No separate camera permission prompt on most browsers because the OS camera app does the capture

The story

What it is

A file button that opens your phone camera or microphone directly and hands over one finished file.

For you

You tap 'Take photo' and your phone camera opens. You shoot, accept, and the page gets just that one picture. It never sees a live camera feed.

For makers

It is the simplest way to collect a photo or clip with no camera code and no permission fuss. Makers use it for ID checks, claims and listings. The person picks what to send.

Where you see it

TypeExampleApps
bankingA bank asks you to photograph your ID and a cheque, then uploads both with one tap.None named
shoppingA marketplace lets you snap photos of an item to sell right from the listing form.eBay, Facebook Marketplace
healthA clinic portal lets you take a photo of a rash for the nurse to see.None named
educationA homework site lets students photograph their work and submit it.None named
deliveryA delivery site asks for a photo of a damaged package.None named
socialA site lets you record a short voice or video note straight into a post.None named
enterpriseA field service app records a photo of a repair as proof of work.None named

Risks

  • Shares a sensitive photo
  • Picks what you send

What the platform says

Good uses and abuse

Legitimate uses

  • Document scanning (ID, receipts)
  • Quick photo upload

Known abuse

  • Pushing people to take photos of sensitive documents

Scores

ScoreValueMeaning
Sensitivity4 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction1 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2016-09, Safari on iPhone 10: capture attribute supported in iOS Safari (BCD)

Sources

How well checked: Based on official documentation.

On this page