Skip to main content
FileKit gives you one API, but platforms differ: browsers can’t write arbitrary files, desktops have no camera picker, and phones have no “Downloads” folder. This page lists what each target supports, based on the library’s platform implementations. Legend: ✅ supported · ⚠️ supported with limitations (see the numbered notes) · ❌ not available
An API marked ❌ is usually not declared at all for that target, so calling it from commonMain won’t compile. Call it from a source set that only includes supported targets. See Use platform-specific APIs from shared code.

Targets per module

Intel-only Apple targets (iosX64, macosX64) are not published.

FileKit Core

Columns: And Android · iOS · mac macOS · JVM JVM desktop · Lin Linux native · Win Windows native · watch watchOS · Web JS and Wasm.

FileKit Dialogs

filekit-dialogs is not available on watchOS. Web means JS and Wasm.

Compose and Coil

Compose Multiplatform has no Linux native, Windows native, or watchOS targets, so filekit-dialogs-compose and filekit-coil don’t either. On macOS native, Compose itself is experimental.

Use platform-specific APIs from shared code

Kotlin’s default hierarchy gives you appleMain, iosMain, nativeMain, and webMain, but no source set for “everything except the web” or “Android and iOS”. Create them in your shared module, following Kotlin’s guide to additional source sets:
build.gradle.kts
Keep only the targets your project declares, and add others (such as macosMain or linuxMain) the same way. Kotlin doesn’t support a source set shared only by Android and JVM: if those are your only non-web targets, call these APIs from androidMain and jvmMain, or wrap them in an expect/actual function. Code in nonWebMain can then call FileKit.openFileSaver(), and code in mobileMain can call FileKit.openCameraPicker().

Notes

  1. Web files are read-only browser handles. Directories report a size of 0. list, walk, and sizeRecursively work on folders returned by the directory picker.
  2. Web writing is experimental. write, writeString, and delete work only on entries in the browser’s origin private file system (OPFS) and require @OptIn(ExperimentalFileKitApi::class) and a secure context. Writing to a picked file throws.
  3. Android content:// files: atomicMove falls back to copy-then-delete and doesn’t support directories.
  4. Linux native: createdAt() always returns null.
  5. macOS native: the output size of compressImage depends on the screen’s backing scale factor.
  6. Throws at runtime on these targets: compressImage on Linux native, Windows native, and watchOS; gallery saving on watchOS returns a failed Result.
  7. Desktop “gallery”: the image or video is written to the user’s Pictures or Videos folder.
  8. Path-based bookmarks: on Windows, Linux, and non-macOS JVM, bookmark data stores the file path. Access is not security-scoped, so the bookmark breaks if the file moves.
  9. JVM dialogs use NSOpenPanel/NSSavePanel on macOS, IFileDialog on Windows, and the XDG Desktop Portal on Linux, falling back to AWT/Swing dialogs when no portal is running.
  10. Linux native dialogs require a running XDG Desktop Portal (org.freedesktop.portal.Desktop, available on GNOME, KDE, and most modern desktops) and libdbus-1. There is no fallback dialog and no parent window. See Dialogs setup.
  11. Web picker uses <input type="file">. The type filter is applied through the accept attribute; directory and dialog settings are ignored.
  12. Media types outside Android and iOS open the regular file dialog filtered by extension: png, jpg, jpeg, gif, bmp for images and mp4, mov, avi, mkv, webm for videos. On the web, they filter with image/* and video/*.
  13. Web directory picker returns a read-only tree of the selected folder. An empty folder returns null, like a cancellation.
  14. Mobile savers: on Android, several allowedExtensions fall back to the */* MIME type. On iOS, allowedExtensions is ignored.
  15. iOS dialog settings: the presenter view controller and asset representation mode are applied; title and canCreateDirectories are currently ignored.
  16. Web serialization compiles but fails: PlatformFileSerializer is declared for JS and Wasm, but serializing or deserializing a PlatformFile throws at runtime. Store something else, such as the file name or bytes.
Something wrong or missing? Open an issue and include the platform and FileKit version.