question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing the filesystem

See original GitHub issue

What’s the recommended approach for an Ionic+Capacitor app to access the filesystem via Electron?

There’s a couple of options:

  1. Ionic’s File plugin: https://ionicframework.com/docs/native/file
  2. Capacitor’s Filesystem plugin: https://capacitorjs.com/docs/apis/filesystem

But none of them allow me to access for example my home directory ~.

With pure Electron I can just use fs but that’s not an option here as I’d like it to work with Android as well.

A recommended approach and perhaps a code example would be really appreciated as the current docs are only focused on iOS and Android for these plugins.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jdgjsag67251commented, Jan 28, 2022

I added a pull-request to the default Capacitor plugins repo that adds support for Electron to the Filesystem plugin: https://github.com/ionic-team/capacitor-plugins/pull/792

2reactions
NeluQicommented, Dec 8, 2021

If you use Directory.Documents as a path on a desktop (Windows 10 and Chrome). Where are the files saved? I notice that it is updated with data but I can’t find it on the disk.

I also join the question

I found out that the files saved with

await Filesystem.writeFile ({ path: ‘AAAAtext222.txt’, data: ‘This is a test’, directory: Directory.Documents, encoding: Encoding.UTF8, });

in the electron assembly for winodws 10

Save to IndexedDB image

I would like to save the files in the root of the program, so where exe. Who knows how?

Read more comments on GitHub >

github_iconTop Results From Across the Web

File System Access API - MDN Web Docs - Mozilla
This API allows interaction with files on a user's local device, or on a user-accessible network file system. Core functionality of this API ......
Read more >
The File System Access API: simplifying access to local files
The File System Access API enables developers to build powerful web apps that interact with files on the user's local device, such as...
Read more >
Windows file system access and privacy - Microsoft Support
In Windows 10, go to Start > Settings > Privacy > File system and make sure Allow apps to access your file system...
Read more >
Getting Started With the File System Access API - CSS-Tricks
The File System Access API is a web API that allows read and write access to a user's local files. It unlocks new...
Read more >
File System Access
This API enables developers to build powerful apps that interact with other (non-Web) apps on the user's device via the device's file system....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found