# show-open-file-picker

> A cross-browser ponyfill or polyfill for showOpenFilePicker

Latest version **0.4.0** (published 2025-07-01) · (MIT-0) license · 0 weekly downloads

## Install

```sh
npm install show-open-file-picker
pnpm add show-open-file-picker
yarn add show-open-file-picker
bun add show-open-file-picker
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2025-07-01 |
| First published | 2024-02-02 |
| Weekly downloads | 0 |
| License | (MIT-0) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jonathan Neal |
| Maintainers | jonathantneal |
| Keywords | access, api, browser, cross-browser, dev, development, dialog, es6, esm, file, files, filesystem, javascript, js, open, pick, picker, platform, polyfill, save, show, showOpenFilePicker, showSaveFilePicker, standard, standards, support, system, upload, user, web |

## Links

- npm: https://www.npmjs.com/package/show-open-file-picker
- Repository: https://github.com/jsxtools/show-open-file-picker
- Issues: https://github.com/jsxtools/show-open-file-picker/issues
- npm.io page: https://npm.io/package/show-open-file-picker

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.4.0 (latest) — 2025-07-01
- 0.3.0 — 2025-05-02
- 0.2.4 — 2025-05-02
- 0.2.3 — 2025-05-02
- 0.2.2 — 2024-04-16
- 0.2.1 — 2024-04-09
- 0.1.2 — 2024-02-05
- 0.1.1 — 2024-02-05
- 0.1.0 — 2024-02-02

## README

# show-open-file-picker

A cross-browser ponyfill or polyfill for `showOpenFilePicker()` and `showSaveFilePicker()`.

The `showOpenFilePicker()` method shows a file picker that allows a user to
select a file or multiple files and returns a handle for the file(s).

```shell
npm install show-open-file-picker
```

[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker)

## Usage

```html
<script src="https://cdn.jsdelivr.net/npm/show-open-file-picker/polyfill.js"></script>

<button id="button">Show Open File Picker</button>

<script>
button.onclick = () => {
  showOpenFilePicker({
    types: [
      {
        description: "Images",
        accept: {
          "image/*": [".png", ".gif", ".jpeg", ".jpg"],
        },
      },
    ],
    excludeAcceptAllOption: true,
    multiple: false,
  })
}
</script>
```

```js
import { showOpenFilePicker } from 'show-open-file-picker'

button.onclick = () => {
  showOpenFilePicker({
    types: [
      {
        description: "Images",
        accept: {
          "image/*": [".png", ".gif", ".jpeg", ".jpg"],
        },
      },
    ],
    excludeAcceptAllOption: true,
    multiple: false,
  })
}
```

---
_Source: https://npm.io/package/show-open-file-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
