---
title: "The File System API with Origin Private File System"
description: "WebKit now supports the File System Standard's origin private file system, a per-origin sandboxed storage area where web apps can create, read, write, move, enumerate and delete files and directories."
url: "https://swe.quest/articles/the-file-system-api-with-origin-private-file-system-d365ac14632ecee7"
canonical: "https://webkit.org/blog/12257/the-file-system-access-api-with-origin-private-file-system/"
source: "WebKit"
published: "2022-02-14"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["browsers","javascript","frontend"]
---

# The File System API with Origin Private File System

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2022-02-14, 6 min read, How-to. Original: [https://webkit.org/blog/12257/the-file-system-access-api-with-origin-private-file-system/](https://webkit.org/blog/12257/the-file-system-access-api-with-origin-private-file-system/)

## Summary

WebKit now supports the File System Standard's origin private file system, a per-origin sandboxed storage area where web apps can create, read, write, move, enumerate and delete files and directories. It is available from Safari on macOS 12.2 and iOS 15.2, has the same lifetime as IndexedDB and localStorage, and is disabled in Private Browsing. Worked examples cover navigator.storage.getDirectory(), getFileHandle/getDirectoryHandle, move(), resolve(), async iteration, removeEntry() and getFile(). Writing in WebKit currently requires FileSystemSyncAccessHandle, which works only in Workers, takes exclusive access to a file, and offers synchronous read, write, truncate and flush for the best performance.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- JavaScript promises and async iterators ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Web Workers

## Keywords

File System API, Origin Private File System, FileSystemSyncAccessHandle, WebKit, Safari, StorageManager

## Related posts

- [Building Profiles with new WebKit API](https://swe.quest/articles/building-profiles-with-new-webkit-api-a47cf901a69ec207.md): WebKit · 2023-08-30 · Medium · 3 min read · Browsers, Mobile, Swift, Privacy
  macOS 14 and iOS 17 add WebKit APIs for creating multiple persistent WKWebsiteDataStore instances, each keyed by a UUID, so apps can build browser-style profiles with separate cookies and website data.
- [Supabase Storage now in Beta](https://swe.quest/articles/supabase-storage-now-in-beta-146dd8398549e2a4.md): Supabase · 2021-07-27 · Medium · 7 min read · Storage systems, Identity & auth, PostgreSQL, JavaScript
  Supabase Storage moves to Beta with range-request streaming for audio/video, whole-bucket public visibility (private by default, to avoid S3-style per-object exposure), directory uploads via the File and Directory Entries API, an RLS policy editor with SQL templates, and a local-filesystem backend so self-hosted setups need no S3.
- [Experimenting with the proposed Cross-Origin Storage API in Transformers.js](https://swe.quest/articles/experimenting-with-the-proposed-cross-origin-storage-api-in-transformers-js-f57157be2f20fb70.md): Hugging Face · 2026-06-23 · Medium · 13 min read · Browsers, Caching, Privacy, Inference & serving, JavaScript
  Browser cache partitioning (in Chrome, keying by Network Isolation Key plus URL) forces every origin running Transformers.js to re-download identical model weights and the ONNX Runtime Wasm file.
- [Updates to Storage Policy](https://swe.quest/articles/updates-to-storage-policy-f18ae8a0ac118dec.md): WebKit · 2023-08-10 · Medium · 4 min read · Browsers, Frontend
  Starting in Safari 17 and WebKit apps on iOS 17, iPadOS 17 and macOS Sonoma, storage quota is a percentage of disk space.
- [Improving the Storage Access API in Firefox](https://swe.quest/articles/improving-the-storage-access-api-in-firefox-aed5f1c78b716040.md): Mozilla Hacks · 2022-02-08 · Medium · 6 min read · Browsers, Privacy, Identity & auth
  Ahead of enabling State Partitioning for all users, Firefox is changing its Storage Access API implementation in four ways.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
