> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Camera and file uploads

> Enable camera access and file uploads in your app.

Camera access and file uploads let users add photos, documents, and other media from your app. Common use cases include profile photos, document submission, in-app image capture, and media sharing in social, e-commerce, and business apps.

This guide covers everything you need to implement camera and file upload support in Median apps on both iOS and Android, including platform-specific configuration for Android camera capture quality and gallery storage.

> [!TIP]
>
> **Developer Demo**
>
> Test camera and file upload functionality during development using the live demo pages.
>
> * File and camera uploads: [https://median.dev/camera/](https://median.dev/camera/)
> * Android camera settings: [https://median.dev/camera-settings](https://median.dev/camera-settings)

## Implementation guide

File and image uploads are natively supported in both iOS and Android WebViews, which power Median's native mobile apps. No additional plugins or configuration are required to enable basic upload functionality.

To enable file or image selection in your web app, use the standard HTML `<input type="file">` element. The native WebView and operating system handle the presentation of the system file picker or camera options to the user automatically.

For the full list of supported attributes and implementation best practices, refer to the [MDN documentation on Input File](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).

### Android camera capture configuration

> [!WARNING]
>
> **Android only**
>
> The camera capture configuration options below are Android-specific and are not supported on iOS.

On Android, Median exposes additional controls for camera behavior via the Median JavaScript Bridge. These settings let you tune capture quality and control how captured media is stored on the device.

#### Capture quality

Android supports two capture quality presets:

| Setting | Description |
| - | - |
| "high" | Maximum resolution and file size (default) |
| "low" | Reduced resolution to minimize file size |

Use the "low" setting when upload speed or server storage costs are a concern. Use "high" (the default) when image fidelity is important.

For technical details on how these quality levels map to Android's media capture API, see the [Android Developer Documentation on EXTRA\_VIDEO\_QUALITY](https://developer.android.com/reference/android/provider/MediaStore#EXTRA_VIDEO_QUALITY).

**Set capture quality via the Median JavaScript Bridge**

Median JavaScript Bridge

```javascript JavaScript theme={null}
// Set camera capture quality to low
median.camera.setCaptureQuality("low")

// Set camera capture quality to high (default)
median.camera.setCaptureQuality("high")
```

#### Gallery storage

By default, photos and videos captured in the app are saved to the device's media gallery. You can disable this behavior if your app processes images server-side and local storage is unnecessary.

This preference persists across sessions once set.

**Control gallery storage via the Median JavaScript Bridge**

Median JavaScript Bridge

```javascript JavaScript theme={null}
// Prevent captured media from being saved to the gallery
median.camera.saveToGallery(false)

// Re-enable gallery saving (default behavior)
median.camera.saveToGallery(true)
```

## Demo app

> [!WARNING]
>
> **Camera unavailable in the iOS simulator**
>
> Due to security policies, camera functionality is disabled in Median's iOS
> simulator. The Android sample app includes an example camera capture.


## Related topics

- [Permissions overview](https://docs.median.co/docs/permissions-overview.md)
- [App Studio Simulators](https://docs.median.co/docs/simulators.md)
- [Customize push notifications](https://docs.median.co/docs/notification-customization.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.