यह पेज अभी हिन्दी में उपलब्ध नहीं है, इसलिए आप इसका अंग्रेज़ी संस्करण पढ़ रहे हैं।

File handling and the File System Access API in PWAs

Open, edit and save real files, like a desktop app.

क्षमताएँ और API मध्यम 1 मिनट में पढ़ें समीक्षा: 27 नव॰ 2026

Editors, design tools and viewers need files. The web now has three levels of file support.

1. Open files from the OS (file_handlers)

Declare file types in the manifest, and your installed app appears in "Open with" menus:

"file_handlers": [
  { "action": "/open", "accept": { "text/markdown": [".md", ".markdown"] }, "launch_type": "single-client" }
]

Receive the files when the app launches:

if ('launchQueue' in window) {
  launchQueue.setConsumer(async (params) => {
    for (const handle of params.files) {
      const file = await handle.getFile();
      openDocument(await file.text(), handle);
    }
  });
}

Supported by Chrome and Edge on desktop for installed apps. The first time, the user is asked to allow it.

2. Pick, read and save files (File System Access API)

const [handle] = await window.showOpenFilePicker({ types: [{ description: 'Markdown', accept: { 'text/markdown': ['.md'] } }] });
const text = await (await handle.getFile()).text();
// ... edit ...
const writable = await handle.createWritable();
await writable.write(newText);
await writable.close(); // saved to the same file

showOpenFilePicker, showSaveFilePicker and showDirectoryPicker are Chromium desktop features. Use browser-fs-access to fall back to <input type="file"> and downloads in other browsers.

3. Private, fast storage (OPFS)

The Origin Private File System gives your app a private file system that users do not see, supported in all modern browsers. It is ideal for caches, large data and SQLite databases:

const root = await navigator.storage.getDirectory();
const fh = await root.getFileHandle('data.bin', { create: true });
const w = await fh.createWritable(); await w.write(bytes); await w.close();

In a worker, createSyncAccessHandle() gives very fast synchronous reads and writes; SQLite Wasm uses it.

Real-world examples: Excalidraw, Photopea and VS Code for the Web all open and save local files.

ब्राउज़र सपोर्ट

PWA फ़ीचर के लिए ब्राउज़र सपोर्ट
फ़ीचरChrome / Edge desktopChrome AndroidSafari iOS / iPadOSSafari macOSFirefox desktopFirefox AndroidSamsung Internet
File handlers Chrome / Edge desktop: हाँ Chrome Android: नहीं Safari iOS / iPadOS: नहीं Safari macOS: नहीं Firefox desktop: नहीं Firefox Android: नहीं Samsung Internet: नहीं
File System Access pickers Chrome / Edge desktop: हाँ Chrome Android: नहीं (OPFS only) Safari iOS / iPadOS: नहीं (OPFS only) Safari macOS: नहीं (OPFS only) Firefox desktop: नहीं (OPFS only) Firefox Android: नहीं Samsung Internet: नहीं
Origin Private File System Chrome / Edge desktop: हाँ Chrome Android: हाँ Safari iOS / iPadOS: हाँ Safari macOS: हाँ Firefox desktop: हाँ Firefox Android: हाँ Samsung Internet: हाँ

पूरी सपोर्ट तालिका देखें