Redirect to local file or web page from Node Red

Hi,

I have node red installed and configured with workflows on a server machine. These workflows are rendered to html web pages using iframe.

Runtime - these htnl pages display the appropriate workflows which are created in the server. I am trying too add file read, file write along with a browser display (using node-red-contrib-nbrowser).

  1. I need to supply the local file path (txt or csv) in the file read and file write operation. Currently i could provide only file paths which are in the server machine and not on the local client machine

  2. Browser also is rendered on server machine and not on local client machine. Using node-red-contrib-java-function - to Open the web page on the browser also resulted in browser open on server where node red in installed.

How to make node red file read/write/redirect URL operations to accept local file paths where i have the web application (and not on the server where node red is installed and configured)

How do i achieve this ? Please support

You cannot mix server with local file operations in a client browser as this would be a massive security risk.

In any case, since you are running the browser on the server, you won't have any client-side access anyway.

There are a number of possible alternative approaches but all would depend on the client being authenticated to the server so that you can create a connection between them.

1 Like

Many thanks for the reply.

Could you please elaborate - "There are a number of possible alternative approaches but all would depend on the client being authenticated to the server so that you can create a connection between them". Any links or pointers would also help

If you want your server app to give information to a client device, it has to be able to authenticate to it. Or, more likely, the client would authenticate to the server. You need an authenticated channel of some kind between the server and the client in order to be able to exchange information safely.

The most common method would be for the client to have a "network share". A shared drive that exists on the server but is accessible from the client. Then the server can put files into it. How you do that depends on the platforms in use.