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.
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Not supported | Not available | Not listed | Desktop falls back to the file chooser |
| Edge | Not supported | Not available | Not listed | Desktop falls back to the file chooser |
| Firefox | Not supported | Not available | Not listed | Desktop falls back to the file chooser |
| Safari | Not supported | Not available | Not listed | Desktop falls back to the file chooser |
| Safari on iPhone | Supported | 10 | 2016-09-13 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 25 | 2013-02-27 | None |
| Samsung Internet | Supported | 1.5 | 2013-09-25 | None |
How a site asks for it
| API | <input type=file accept="image/*" capture="environment">; capture=user |
| Browser compat keys | html.elements.input.captureapi.HTMLInputElement.capture |
| How access is granted | picker |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | Yes |
| Activation | transient |
| How long it lasts | Per capture |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Works in any frame |
Typical flow
- Person taps the input
- Camera or voice recorder app opens
- 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
| Type | Example | Apps |
|---|---|---|
| banking | A bank asks you to photograph your ID and a cheque, then uploads both with one tap. | None named |
| shopping | A marketplace lets you snap photos of an item to sell right from the listing form. | eBay, Facebook Marketplace |
| health | A clinic portal lets you take a photo of a rash for the nurse to see. | None named |
| education | A homework site lets students photograph their work and submit it. | None named |
| delivery | A delivery site asks for a photo of a damaged package. | None named |
| social | A site lets you record a short voice or video note straight into a post. | None named |
| enterprise | A 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
- MDN: HTML capture attribute. Documents a tag that asks a phone to open the camera or recorder to fill a file field.
Good uses and abuse
Legitimate uses
- Document scanning (ID, receipts)
- Quick photo upload
Known abuse
- Pushing people to take photos of sensitive documents
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 4 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2016-09, Safari on iPhone 10: capture attribute supported in iOS Safari (BCD)
Related capabilities
Related
- File input (choose files to upload). Can open only the files you pick in the file chooser
Sources
How well checked: Based on official documentation.