Questions related to The new Native File System API which allows web apps to read or save changes directly to files and folders on the user's device.
Questions tagged [native-file-system-api-js]
40 questions
4
votes
2 answers
How to avoid two sequential alerts (one for read and one for edit) when using `window.showDirectoryPicker()`
const dirHandle = await window.showDirectoryPicker();
await dirHandle.requestPermission({ mode: "readwrite" });
I'm using the File System Access API in chrome. I'd like to let the user pick a folder, then write into the folder.
My code works, but…

ZYinMD
- 3,602
- 1
- 23
- 32
3
votes
1 answer
Is there a way to programmatically set the default directory with File System Access API
Is there a way to set a defined directory path programmatically instead of showing the file explorer with .showDirectoryPicker() for the user to select the actual path?

gby
- 121
- 8
3
votes
1 answer
How to provide default filename for showSaveFilePicker
I am wanting to provide a spinner in my web app as I download a file from the server and then save it using the File System Access API.
I can do this using the showSaveFilePicker() but it seems very odd that I can't specify a default filename. I…

Roaders
- 4,373
- 8
- 50
- 71
3
votes
1 answer
Open folder in Windows Explorer using Native File System API
Note: There are already some questions on how to open Folder on User device using Javascript. however, these questions were asked, before the Native File System API.
How to open Window File Explorer from web browser using javascript
Open local…

Adarsh Madrecha
- 6,364
- 11
- 69
- 117
2
votes
1 answer
Get a list of all files within a directory in a client machine using browser
The use case here is not that important though but the use actually is. I want to browse the users local file system via browser like we do via but instead of picking up a file I want to pick up a directory and get list of all…

Atul Bhatt
- 485
- 1
- 6
- 15
2
votes
1 answer
File System Access API open file with local default application
In a web application I am working on I would like to be able to download files, modify them localy and reupload them to the server.
To make it as easy as possible for the users, I would like them to choose the download location and use a single…

Robert P
- 9,398
- 10
- 58
- 100
2
votes
1 answer
Store the path to uploaded file on client-side or the file outside the browser for offline
Is there a way to store the path to file which user wants to upload, but doesn't have an internet connection (it's a PWA) and reupload it when a connection is back? Or maybe not store the path, but save the file outside browser storage, somewhere on…

Mateusz Adamczyk
- 40
- 4
2
votes
1 answer
Overriding showOpenFilePicker with Puppeteer
As illustrated in here here, Puppeteer allows to override Javascript functions. I want to override showOpenFilePicker function. That is, when the showOpenFilePicker invoked by the web page. I want to run another function before the…

knave123
- 51
- 4
2
votes
1 answer
Need to hook to function of the Web API, is it possible?
I'm trying to hook into a function that comes with the File System Access API.
For example when the web site used the File System Access API as shown in below.
// store a reference to our file handle
let fileHandle;
async function getFile() {
//…

knave123
- 51
- 4
2
votes
1 answer
FileSystemApi and writableStream
I'm trying to use the FileSystem API to write an uploaded file on a SPA to a Local sandboxed FileSystem using the FileSystem API.
The File Is uploaded with drop acion and I can get the File object array in the call back.
From the File I can get the…

alexroat
- 1,687
- 3
- 23
- 34
2
votes
1 answer
Chrome File System API hanging
disclaimer, self-answered post to hopefully save others time.
Setup:
I've been using chrome's implementation of the file systems API, [1] [2] [3].
This requires enabling the flag chrome://flags/#native-file-system-api.
For starters I want to…

junvar
- 11,151
- 2
- 30
- 46
1
vote
0 answers
How get list Provides a handle to a directory entry in File System Access API?
I am get directory from file system and read data.
try {
const directoryHandle = await showDirectoryPicker({
startIn: startIn.value,
});
for await (const [name, fileHandle] of directoryHandle) {
directory.textContent = …

Sergey
- 418
- 1
- 7
- 21
1
vote
0 answers
Trying to generate a 20+ gb zip file with JSZip + File System Access API, always fails around 20 GB
I've been experimenting with the file system access API recently to try to allow downloads of large directories from my site, where a page will start a write stream, start fetching the files, consolidate them into a zip file using JSZip, and save…

roachie
- 31
- 3
1
vote
0 answers
Flushing file's with webkit's filesystem API with Safari
I am trying to use filesystem api to create permanent files, write and read data from them.
Although I succeeded creating the file and writing data to it, after calling flush() the file becomes empty (and it's size is 0).
The files that I created…

Dave
- 11
- 2
1
vote
2 answers
How do I actually add Filesystem Access API to javascript?
I've found this https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API to allow javascript to access the local file system. I feel really dumb, but I can't find anywhere that talks about how to actually add the api. I would really…

nardstorm
- 11
- 2