How it works
- The user picks a source. On a phone: take a new photo with the camera, or choose from the photo library (the system photo pickerPhoto pickerThe system screen for choosing photos, which on iOS and Android can be used without full library permission.Open in glossary →) or the Files app. On the web: a file chooser (the browser’s “Choose file” dialog), drag and drop, or paste from the clipboard. On phones, the browser’s file chooser also offers the camera and photo library.
- The app may need permission. Using the camera inside the app needs the user’s permission (on Android, an app that simply hands off to the system camera app may not). Photo library access depends on how the app asks (more below).
- The app checks the file. Is it an allowed type? Is it under the size limit? Are there too many files? Good apps check before uploading, so the user doesn’t wait a minute just to get an error.
- The app prepares the image. Often it resizes and compresses (a 12-megapixel photo is rarely needed for a 400-pixel avatar), converts formats, applies rotation and removes private metadata: extra information stored inside the file next to the picture, such as where and when the photo was taken.
- The upload runs. The file is sent over HTTPSHTTPSThe secure version of HTTP; traffic between the browser or app and the server is encrypted.Open in glossary →, ideally with a progress bar and a Cancel button. On a slow network this can take a long time, so the app must handle drops, retries and the user leaving the screen.
- The server validates it again. It checks the real content (not just the file name), the size, and the type, then usually saves a fresh copy of the image (re-encodes it) and creates thumbnails. Never trust the client (the app or browser on the user’s device): anyone can skip its checks.
- The app shows the result. A thumbnail, a clear error, or a “Retry” option. The uploaded image should look exactly like the one the user picked.
Sources and permissions
| Source | iOS | Android | Web |
|---|---|---|---|
| Camera | Permission prompt on first use | Permission prompt on first use | A mobile site can open the phone’s camera app directly (no prompt); a live camera view inside the page makes the browser ask for permission |
| Photo picker | System picker: no permission. Full library access: prompt with Limit Access | Photo Picker: no permission. Media access: Android 14+ allows selected photos only | File input opens the phone picker or desktop dialog |
| Files / drag & drop / paste | Files app via document picker | Files via the system file chooser | Drag onto a drop zone, or paste a screenshot with Ctrl/Cmd+V |
Dev note
capture attribute on a file input is what opens the phone’s camera app directly.PermissionsApp permissionsThe user's approval for an app to use things like the camera, location, contacts or notifications.Open in glossary → create their own test cases. The system shows a modal the app can’t style, and the user can say Don’t Allow, pick Limit Access / selected photos only, or later revoke access in Settings. Each answer needs a sensible result: no crash, no empty screen, and a clear way to the Settings app if the user changes their mind. The whole topic has its own lesson, App permissions, and the differences between platforms are covered in iOS vs Android.
Formats, sizes and the files you should keep ready
| Format | Where it comes from | What to watch |
|---|---|---|
| JPEG | Most cameras, Android, older iPhones | Big files from modern cameras, sideways photos (EXIF rotation, explained in the next part) |
| HEICHEICThe high-efficiency image format iPhones use by default; not every server or browser supports it.Open in glossary → | iPhone camera default (“High Efficiency”) | Servers and browsers that don’t support it; must be accepted or converted |
| PNG | Screenshots, logos, graphics | Transparency turned black or white; large file sizes |
| WebP | Web downloads, some Android apps | Accepted by the server? Shown correctly everywhere? |
| GIF | Memes, animations | Animation lost after resizing, or rejected without a clear message |
Every product has limits: allowed types, a maximum file size (for example 10 MB), maybe a maximum resolution and a maximum number of files. Treat them like any other rule and use boundary value analysisBoundary value analysisTesting values at and just around the edges of valid ranges, where bugs love to hide.Open in glossary →: just under, exactly at, and just over the limit. And the user must be told the limit, ideally before they pick, and again in the error. Ask what “10 MB” means exactly: 10,000,000 bytes or 10,485,760 bytes (10 × 1024 × 1024). Apps, servers and the phone’s own file info don’t always agree, and that gap is where boundary bugs hide.
Check this part
Uploads from iPhones fail, uploads from Android phones work. Which format should you test first?
The user gave the app limited access (selected photos only). What should you check?
Why should the app check the file type and size before the upload starts?