0

I create one software in electron. I need to add image upload functionality into it. Uploaded images will store in a local drive(D:// Drive) folder and also on preview time I need to access the same folder so I have not idea it is possible in electron and if yes then how can I do this?

And for an extra thing in the backend, I use nodejs if you have an idea about that thing is possible using node js then also tell me so I can integrate with node js also. just I need to store that images to a particular folder which is in my local drive and I also access that image from my local drive for preview things.

Uttam Moradiya
  • 67
  • 1
  • 1
  • 9

1 Answers1

1
  1. For selecting file to upload trigger event (ex. upload-start) through ipc from render process.
  2. In main process in handler for this event use dialog module and .showOpenDialog() method which will return a path to the file.
  3. Then in main process you can use fs module to work with file: read it, copy, move, rename and write.

And check How do I handle local file uploads in electron?

sanperrier
  • 606
  • 5
  • 12