Skip to content
Bugwise
Menu
Features & Flows

Image Upload

How photo and file uploads work on iOS, Android and the web, why HEIC, EXIF rotation, big files and bad networks break them, and how to test uploads end to end.

45–70 min intermediate Mobile & web

A seller on a second-hand marketplace takes three photos of her sofa and taps Publish. The first photo shows up lying on its side. The second fails with “Something went wrong”. The third uploads fine, and with it, hidden inside the file, the GPS coordinates of her living room, which any buyer can now download.

Profile pictures, receipts in expense apps, ID checks in banking apps, damage photos in insurance claims, food photos in reviews: image upload is everywhere. It looks like one button, but behind it are cameras, permissions, a dozen file formats, huge files, flaky networks and real privacy risks. That’s why upload is a feature where testers who know what to feed it find a lot of serious bugs.

Part Not started

How it works

  1. 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.
  2. 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).
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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

SourceiOSAndroidWeb
CameraPermission prompt on first usePermission prompt on first useA 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 pickerSystem picker: no permission. Full library access: prompt with Limit AccessPhoto Picker: no permission. Media access: Android 14+ allows selected photos onlyFile input opens the phone picker or desktop dialog
Files / drag & drop / pasteFiles app via document pickerFiles via the system file chooserDrag onto a drop zone, or paste a screenshot with Ctrl/Cmd+V
Dev note
On the web, the 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

FormatWhere it comes fromWhat to watch
JPEGMost cameras, Android, older iPhonesBig 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
PNGScreenshots, logos, graphicsTransparency turned black or white; large file sizes
WebPWeb downloads, some Android appsAccepted by the server? Shown correctly everywhere?
GIFMemes, animationsAnimation 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

  1. Uploads from iPhones fail, uploads from Android phones work. Which format should you test first?

  2. The user gave the app limited access (selected photos only). What should you check?

  3. Why should the app check the file type and size before the upload starts?

Upload is a flow: source, permission, checks, preparation, upload, server validation and result. Plus the sources, permissions, formats and limits you'll meet.

Part Not started

Inside the file, on the network, on the server

EXIF: rotation and location hidden in the file

Phone cameras don’t actually rotate the image when you hold the phone upright. They save the pixels as the sensor saw them, and write a note into the photo’s EXIFEXIFMetadata stored inside a photo: camera, date, orientation and often the exact GPS location.Open in glossary → data (the metadata block inside a photo file). That note, the Orientation tag, says “rotate this 90° when you show it”. Apps that ignore that tag show portrait photos sideways. EXIF can also contain the camera model, the date and the exact GPS location where the photo was taken.

Try it: pick the portrait photo, then switch the app’s handling on and off. Then see what the server keeps.

Photo taken

1. Pixels stored in the file

Pixel size4032 × 3024
Orientation6 (rotate 90° clockwise)
CameraiPhone 15
GPS45.8150 N, 15.9819 E

2. What the app shows

The app ignored the tag and drew the raw pixels. This is the classic "my photo uploaded sideways" bug.

3. What the server keeps

Pixel size4032 × 3024
Orientation6 (rotate 90° clockwise)
CameraiPhone 15
GPS45.8150 N, 15.9819 E

Anyone who downloads this photo can see where it was taken, often the seller's home.

Upload on a real network

A 4 MB photo takes a fraction of a second on office Wi-Fi and half a minute on a weak mobile signal. Testers check what happens in between:

  • Progress: the bar moves, and after reaching 100% the app shows that the server is still processing (instead of a full bar that seems frozen).
  • Cancel: the user can stop an upload that’s taking too long or was the wrong photo.
  • Lost connection: the app tells the user, keeps the photo, and retries when the network returns (or offers a Retry button). It never silently drops the photo. See Network conditions for how to simulate this.
  • Leaving the app: if the user switches apps or locks the phone, either the upload continues in the background (iOS and Android both support background transfers) or it resumes cleanly when the app returns (Background and foreground).
  • Double submitDouble submitA bug where an action runs twice because the user tapped or clicked twice quickly.Open in glossary →: tapping Post twice must not upload the same photo twice.

Server-side validation (the defensive basics)

File upload is one of the classic places where attackers try to sneak in something that isn’t an image. You don’t need to be a security expert to check the basics in a test environmentEnvironmentA setup of servers, data and configuration where the software runs, such as dev, staging or production.Open in glossary → with harmless test files:

  • Rename a text file (or a PDF) to photo.jpg and upload it. The server should reject it because it looks at the content, not the name: the first bytes of a file reveal its real type (its file signatureFile signatureThe first bytes of a file that reveal its real type, regardless of the extension.Open in glossary →). A clear message like “This file isn’t a valid image” is enough.
  • Upload a file over the size limit through the web version and through the app. Both should be rejected by the server too, not only by the app.
  • After a successful upload, open the stored image’s address (long-press or right-click the image and open it in a new tab). It should open as a picture, under a random-looking file name, not under the original name the user gave it.
  • Download the stored image and look inside it (see the tip above): no location data where the spec says it must be removed.

Report anything suspicious and let the security team go deeper. See Security basics for the wider picture.

Example requirements

Check this part

  1. An iPhone user's portrait photo shows up sideways after upload, but landscape photos are fine. What is the most likely cause?

  2. A photo is uploading on a weak signal and the connection drops. What should a good app do?

  3. You rename notes.txt to notes.jpg and the server accepts it. What does this tell you?

Why portrait photos land sideways and carry GPS coordinates (EXIF), what an upload must survive on a slow or lost connection, the server-side checks, and example requirements.

Part Not started

What usually goes wrong

#BugWhat you seeTypical severity
1HEIC not supportediPhone photos fail, often with a generic errorHigh (many users affected)
2EXIF orientation ignoredPortrait photos sideways or upside down, in the app, on the web or only in thumbnailsMedium–High
3Size limit hiddenBig files upload for a minute and then fail, with no limit mentionedMedium
4No progress, no cancelSpinner forever, bar stuck at 100%, no way to stopMedium
5Network loss handled badlyPhoto silently disappears, or the app hangs; no retryHigh
6Location metadata keptDownloaded photo reveals where the user livesHigh (privacy)
7Transparency lostTransparent PNG logo gets a black backgroundLow–Medium
8Over-compressionUploaded photo is blurry or blocky, text in receipts unreadableMedium
9Permission edge casesCrash or blank screen after “Don’t Allow” or limited accessHigh
10Content not validated on the serverA renamed non-image file is accepted and storedHigh (security)
11DuplicatesDouble tap or retry uploads the same photo twiceLow–Medium
12Accessibility gapsUpload button with no label, progress not announced, drag and drop onlyMedium–High

Find the bug

Swapsy’s “New listing” screen below has six bugs. Use the test photo library like a tester would:

  • Add photos one at a time and several at once. Read every message.
  • Compare each thumbnail with the photo in the picker.
  • Switch the network to Slow 3G, watch the progress bar, then try Offline in the middle of an upload.
  • Tap uploaded photos to see what the server stored, and watch the network log.
  • Check the Files tab too.

🐞 Bug hunt: Swapsy photo upload

This demo has 6 hidden bugs. Explore it like a tester, then check your findings.

Found0/6
9:41
CancelNew listingNext

Photos · 0/5

Add up to 5 photos. The first one is the cover.

Details

TitleTeal 3-seat sofa
Price€180

Network

From the spec

Accepted: JPEG, PNG, HEIC, WebP · max 10 MB per photo · up to 5 photos. Uploads can be canceled. Location data must be removed before photos are stored.

Tap an uploaded photo to see what the server stored. Use Slow 3G to watch uploads closely.

Network log

  • Add photos to see requests…
  1. 1

    Hint: Add IMG_2041.HEIC, the iPhone camera default format.

  2. 2

    Hint: Add IMG_2087.JPG and compare the thumbnail with the picker.

  3. 3

    Hint: Add DSC_0912.JPG (12.4 MB) and read the error.

  4. 4

    Hint: Switch to Slow 3G and add a photo. Try to stop it.

  5. 5

    Hint: Start an upload on Slow 3G, then switch to Offline.

  6. 6

    Hint: Tap an uploaded phone photo and read what the server stored.

Check this part

  1. Why is location data in an uploaded photo a problem on a marketplace?

  2. A transparent PNG logo gets a black background after upload. Which bug is this?

Typical upload bugs, from rejected HEIC photos to location data left in the file, then a buggy listing screen to explore.

Part Not started

Test scenarios

Before you start, prepare:

  • The upload test kit from the first part, on your computer and on the test phones. A real portrait photo taken with an iPhone covers HEIC, rotation and location in one file.
  • The limits from the spec: allowed formats, maximum size, maximum number of photos. If they aren’t written down, ask. You can’t test a boundary you don’t know.
  • A way to slow down and cut the network. Airplane mode is enough to begin with. Network conditions shows how to simulate a slow connection.
  • A test environment for anything in Security and privacy. Never try renamed or oversized files against the live product.

The bullets that mention a proxy, DevTools or an API tool are for when you already use those tools. Everything else needs only the app and your test files.

Functional

  • Add a photo from the camera, the photo library and Files. On the web: file chooser, drag and drop, paste.
  • Add one photo, then several at once, then exactly the maximum, then try one more.
  • Each accepted format uploads and looks right: JPEG, PNG, HEIC, WebP (and GIF if supported).
  • Remove a photo, reorder photos (if supported), replace the cover photo.
  • The uploaded image looks the same in the app, on the web, and in notifications or emails that show it.

Negative

  • A file over the size limit, a format that isn’t allowed, a 0-byte file, a corrupted image.
  • A non-image file renamed to .jpg (use a harmless text file).
  • Don’t Allow for camera or photos; then enable it later in Settings and come back.
  • Cancel the picker without choosing anything: the app should return to where it was.

Edge cases

  • Boundaries: a file just under, exactly at and just over the size limit; the maximum number of photos and one more. (To get a file of a certain size, export the same photo at different quality settings, or ask a developer for prepared files.)
  • Rotation: portrait, landscape, upside down and selfie (front camera) photos. Check thumbnails, full view and the web version.
  • Extreme shapes: a very wide panorama, a 1×1 pixel image, a huge-resolution image under the size limit.
  • Transparency: a transparent PNG keeps its transparency (or gets an intentional background).
  • Limited photo access on iOS and Android 14+: only selected photos are visible, and the user can add more.
  • Same photo twice, and double tapping Upload or Post.

Network and app lifecycle

Security and privacy

Accessibility

Check this part

  1. The limit is 10 MB. Which set of files gives the best boundary test?

  2. On the web, why must drag and drop have a normal button alternative?

Sources and formats, limits and boundaries, rotation, slow and lost networks, privacy and accessibility.

Part ProNot started

Example test cases

These cases are written for Swapsy’s “New listing” screen and its requirements (5 photos, 10 MB each, HEIC converted to JPEG). You need the test kit, an iPhone for TC-UPL-001, a way to slow the network for TC-UPL-005 and 006, and a test environment for TC-UPL-007.

TC-UPL-001Upload a HEIC photo from an iPhone

Preconditions

  • iPhone camera format set to High Efficiency (Settings › Camera › Formats)
  • A new photo taken with the camera

Steps

  1. Open New listing
  2. Tap Add photos and choose the photo
  3. Wait for the upload to finish
  4. Open the listing on the website

Expected result

The photo uploads without errors and is shown correctly in the app and on the website (stored as JPEG).

TC-UPL-002Portrait photo is shown upright

Preconditions

  • Photo taken with the back camera, holding the phone upright (its EXIF Orientation is then usually 6: rotate 90°)

Steps

  1. Add the photo to a listing
  2. Check the thumbnail, the full-screen view and the website

Expected result

The photo is upright everywhere. Stored dimensions are portrait (e.g. 3024 × 4032).

TC-UPL-003Size limit boundaries

Steps

  1. Add a 9.9 MB photo
  2. Add a photo of exactly 10 MB
  3. Add a 10.1 MB photo

Test data

Limit: 10 MB per photo. Agree first whether that means 10,000,000 or 10,485,760 bytes, and build the files to match.

Expected result

9.9 MB and 10 MB upload. 10.1 MB is rejected before uploading with "This photo is larger than 10 MB. Choose a smaller one."

TC-UPL-004Location metadata is removed

Preconditions

  • A JPEG photo that contains GPS coordinates

Steps

  1. Upload the photo from a computer (so the phone can't remove the location first)
  2. Download the stored image from the listing
  3. Open its file properties or an EXIF viewer

Expected result

No GPS or camera metadata in the stored image. The photo is still upright.

TC-UPL-005Connection lost during upload

Preconditions

  • A slow connection (network throttled to a slow 3G profile, or a weak mobile signal)

Steps

  1. Add a 4 MB photo
  2. At about 50%, switch on airplane mode
  3. Wait 10 seconds
  4. Switch airplane mode off

Expected result

The photo stays in the grid with "Waiting for connection" and finishes uploading after the network returns. Only one copy is stored.

TC-UPL-006Cancel an upload

Preconditions

  • Slow network

Steps

  1. Add a large photo
  2. Tap the cancel (×) button while it uploads

Expected result

The upload stops, the photo is removed from the grid, and the server does not store it.

TC-UPL-007Renamed non-image file is rejected

Preconditions

  • Test environment
  • A plain text file renamed to notes.jpg

Steps

  1. Upload notes.jpg from Files (app) or the file chooser (web)

Expected result

The upload is rejected by the server with a specific message ("This file isn't a valid image"). Nothing is stored.

TC-UPL-008Camera access denied

Preconditions

  • Fresh install

Steps

  1. Tap Add photos › Take photo
  2. Choose "Don't Allow" for camera access
  3. Tap Take photo again

Expected result

No crash. The app explains why it needs the camera and offers a button that opens the app's Settings page.

Tip: click a test case to expand it.

Check this part

  1. A photo is uploading on a weak signal and the connection drops. What is expected?

  2. What should happen when the user cancels an upload?

Test cases: HEIC, portrait photos, size boundaries, metadata, lost connection, cancel, a renamed file and denied access.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Part ProNot started

Mobile vs web

  • File chooser: check the file type filter (does the dialog hide non-images?), multiple selection, and that a file picked through the dialog’s “All files” option still gets validated.
    Dev note
    The filter is the accept attribute on <input type="file">, and multiple allows several files. More in File upload.
  • Drag and drop: drop one file, several files, a folder, a non-image, and a file onto the page outside the drop zone (the browser shouldn’t just open the image and leave your page).
  • Paste: paste a screenshot from the clipboard with Ctrl/Cmd+V, if the feature supports it.
  • Mobile browsers: on phones the file input offers camera, photo library and files. iOS Safari may convert HEIC to JPEG on the way (it depends on the file type filter); don’t assume, check what the server received.
  • DevTools: throttleNetwork throttlingDeliberately slowing the connection to test how an app behaves on poor networks.Open in glossary → the network, watch the upload request, its size and status code (DevTools for testers). Try going offline from the Network panel mid-upload.
  • Leaving the page: refreshing or closing the tab during an upload should warn the user or resume cleanly.
  • Cross-browser: check Chrome, Safari and Firefox, especially for HEIC, WebP and EXIF rotation.

Check this part

  1. How do you get a test photo onto an iOS Simulator or Android emulator?

  2. Why test HEIC with a real iPhone photo?

Phones bring photo pickers, HEIC, cameras and background uploads; the web brings file choosers, drag and drop, paste and DevTools.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Checklist

Image upload checklist

0 of 14 checked

Key takeaways

  • Upload is a flow: source, permission, checks in the app, preparation (resize, rotate, strip metadata), upload, server validation, result. Bugs hide in every step.
  • Keep a test kit: HEIC, portrait, huge, just-under-the-limit, transparent PNG, GIF, WebP, a photo with GPS, a 0-byte file and a renamed non-image.
  • The classic bugs: HEIC rejected, sideways photos, hidden size limits, no cancel or progress, silent loss when offline, and location data left in the file.
  • Test uploads on slow and lost networks and while the app goes to the background.
  • Never trust the client: the server must check the real content, the size and the type, and errors must say exactly what’s wrong.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.