I have installed "node-red-contrib-better-sftp" into my node red and using this am trying to create the file with the content into the SFTP folder.
Issue : i have done the configuration and able to create a file into my specified folder but it is a empty is getting created.
Please suggest/guide me if i am missing anything on this code.
I think the important point is that if msg.payload.data is a string it will be considered to be a path to a local file, where local means on the machine running the Node-RED backend.
So in this case the node will look for the file ./data/testfile/SAMPLE.txt. That is a relative path which may also be a problem as I can never remember without testing if this ends up being relative to the directory Node-RED was started from or somewhere else.
If you just want to write a string to the file then it needs to be converted to a buffer first.