ElectronJS: File IO

Working with files (I/O) in an Electron application

In this lesson, we are going to create an Electron application with a file drag and drop feature. We are also going to see how to manage application-related file storage on the system.

Uday Hiwarale
JsPoint
Published in
13 min readDec 29, 2020

--

(source: unsplash.com)

In the previous lesson, we learned about the anatomy of an Electron application and how main and renderer processes play their role in the lifecycle of the application. We also built a sample app to resize and display a random image from the internet.

⚠️ If you haven’t read the previous lesson, please do. Most of the things explained in this lesson won’t make sense unless you get an overview of how Electron applications work.

In this lesson, we are going to create a sample Electron application with the following objectives:

  1. Add a file(s) to this Electron application using the “Drag and Drop” feature as well as by manually displaying the file explorer (system) dialog to select one or multiple files.
  2. Display system notification when a file(s) is added.
  3. On application relaunch, display the list of files.
  4. The User should be able to drag or download…

--

--