#Send file from Renderer to Main process

1 messages · Page 1 of 1 (latest)

twilit bane
#

As part of my renderer process I prompt the user to select a deployment file .dep (zip file) and i would like to pass this to the main process to be sent over SerialPort communication. What is the best way to send this to the main process from renderer? Currently i'm using the preload.js to handle my other communication

viral crest
#

Nodejs fs module

twilit bane
#

on the renderer side i can already read the file, I just was not sure how to send that from renderer to main. or can i just pass the file once i read it on the reactjs side

viral crest
#

What do you do with that file?

#

And why do you need that file in main?

twilit bane
#

so from the UI the user selects the file (its a zip) this needs to go to the main to be sent over serial port to an embedded system that i communicate over serial port

#

so the main handles all communication with the serial port

#

it will get chunked out and sent over serial to the device (firmware essentially)

viral crest
#

Then send file path

twilit bane
#

could there be any permission issues potentially?

viral crest
#

Permission issue?

#

If you able to read file

twilit bane
#

lets say if the user saves the file in their user directory

viral crest
#

So?

#

If application able to write

#

Its able to read it