◉RORK LABJP
●EXPO 58 — Expo is still on expo@58.0.25 (11/12), with no newer release yet●RORK — The rork.com changelog still shows 9/29 as its latest entry●GEMINI 2.5 — gemini-2.5-flash and pro shut down on the API on 12/1, 14 days left. Allow for review time if model names ship in your app●AGE RANGE — Developers ask how to tell apart the three new iOS 27 age-range errors in their apps●WATERMARK — Claude-generated text carries a watermark from 11/16; worth checking if your app ships AI-written copy●NEW — Turning Off cameraPermission Broke QR Scanning●EXPO 58 — Expo is still on expo@58.0.25 (11/12), with no newer release yet●RORK — The rork.com changelog still shows 9/29 as its latest entry●GEMINI 2.5 — gemini-2.5-flash and pro shut down on the API on 12/1, 14 days left. Allow for review time if model names ship in your app●AGE RANGE — Developers ask how to tell apart the three new iOS 27 age-range errors in their apps●WATERMARK — Claude-generated text carries a watermark from 11/16; worth checking if your app ships AI-written copy●NEW — Turning Off cameraPermission Broke QR Scanning
Articles/Dev Tools
⬡ Dev Tools/2026-06-26Advanced

Import the User's Own Image From the Files App in a Rork App, Without the URL Going Stale

Pull images from the Files app or iCloud Drive and the URL you picked goes invalid moments later. Here is how expo-document-picker, security-scoped URLs, and a reliable copy into your sandbox actually work, with running code.

Rork616Expo236iOS118Document PickerFile Management

✦ Premium Article

The line I wanted to add to my wallpaper app was simple: "You can use your own images too." It came after a user wrote in asking to edit a photo they had taken and use it as a wallpaper. If the picture lives in the camera roll, expo-image-picker is enough. But the images people actually want are not always in Photos. A design asset parked in the cloud, a single file received over AirDrop, a folder organized inside iCloud Drive. Those live in the "Files" app, not in "Photos."

So I added expo-document-picker, and selection worked on the first try. The problem showed up later: the imported image could not be opened the next day. The reason comes down to one fact. iOS does not hand you the real file inside the Files app. As an indie developer at Dolice, I hit these in a specific order, and this article walks through that same order: the minimal document picker, why the URL dies, copying reliably into the sandbox, and the native Swift route for Rork Max.

What the photo picker reaches, and where the file picker is needed

expo-image-picker works against the Photos framework, meaning the camera roll and albums. The "Files" app is a different entry point that spans On My iPhone, iCloud Drive, and third-party provider extensions like Dropbox or Google Drive.

The two also differ in their permission model. The photo picker copies the one item the user chose and hands it over, so your app needs no photo library permission. The document picker also grants access "only for the moment," but the way it does so is the catch. Since the target sits outside your app's sandbox, the URL has a lifespan. Save that uri without understanding this, and it will break on you.

The minimal expo-document-picker, and the first wall

Here is the straightforward version.

import * as DocumentPicker from 'expo-document-picker';
 
async function pickImageFromFiles() {
  const result = await DocumentPicker.getDocumentAsync({
    type: ['image/jpeg', 'image/png', 'image/heic'],
    copyToCacheDirectory: true,
    multiple: false,
  });
 
  if (result.canceled) return null;
 
  const asset = result.assets[0];
  // asset.uri / asset.name / asset.size / asset.mimeType
  return asset.uri;
}

With copyToCacheDirectory: true, Expo copies the file into your app's cache and returns a file:// URI. It displays fine. The trap is next. The cache directory (FileSystem.cacheDirectory) is a temporary area the OS may clear at any time, on storage pressure or during an app update. Persist that uri in AsyncStorage to restore "the same wallpaper next launch," and one day it simply will not read.

Set copyToCacheDirectory: false and you skip the copy for speed, but what comes back is a security-scoped temporary URL. It is valid only inside the selection callback, and is revoked the instant you carry it elsewhere. On Android you get a content://, also unfit for long-term storage.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Why copyToCacheDirectory flips the behavior, and the documentDirectory rescue code that survives cache eviction
✦Handling startAccessingSecurityScopedResource and NSFileCoordinator correctly in Rork Max native Swift (iOS 16+)
✦Concrete fixes for not-yet-downloaded iCloud files, HEIC, oversized files, and multi-selection
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-10-30
It runs in development but the iOS Release build dies on launch — checking whether a missing scheme is the cause
In an expo-router app, an app.json with no scheme can crash only the iOS Release build at launch. Why Debug and Android survive, the two ways to fix it, how to think about leaving the scheme out on purpose, and a pre-submission check.
⬡ Dev Tools2026-09-21
A build that stops with exit code 0 — the flag that silenced the log, and the check that let an empty file through
Two reports landed in the same week: eas build --local stopping with exit code 0 but produced no further output, and a zero-byte stub that never got embedded. Both came down to settings that reduce output. Here is how to audit your own scripts.
⬡ Dev Tools2026-09-05
Your Widget Extension Can Submit a BGTaskScheduler Request. It Just Cannot Register the Handler
Calling BGTaskScheduler from a widget extension compiles, submits, and returns true — and then nothing runs. Here is why registration belongs to the host app only, and how I moved refresh ownership back where it belongs across my wallpaper apps.