Go Pro Sign Up Login

Buy Now and unlock this series

$

39

.99

$

24

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Reading A File

I’ll be showing how you can add a file to the Main process using our new Menu skills to trigger a function to open and read a file. You’ll learn some of the core functions that will enable you to read entire directories-worth of files and edit, modify, save, and create new files.

Downloads

Become a pro to download code and videos

Comments

N. SK

over 1 year ago

@Chris Borchert's solution worked for me as well. Would be great to have an updated video series @LevelUp

Blake

about 2 years ago

@Chris Borchert That's exactly what I experienced as well; using dialog.showOpenDialog() actually throws errors with the file path that's returned not being a string. Adding a global mainWindow ( let mainWindow ), since reviewing Scott's course repo shows that I missed that step in a video, plus using dialog.showOpenDialogSync() resolved any issues I had using the current version of electron.js.

Chris Borchert

about 2 years ago

Any one else having any issues using a newer version of Electron should either make sure to have the correct version of electron or use dialog.showOpenDialogSync() instead of dialog.showOpenDialog(), since dialog.showOpenDialogSync returns a Promise now.

Want to join the conversation?

Become a Pro member today!