No File Out Node - Am I missing something?

Issue

I have an XML string from an xml node which I know is the right XML I'm looking for.

I'd now like to write this to a file.

I've seen a "File Out" node mentioned but I don't seem to be able to see it anywhere within my Node-Red panel - which is strange...

image

What I've Tried so Far

I've tried a "File" node with various different filenames, both absolute and relative paths with a combination of different settings and still can't seem to get this file to save anywhere.

What I need help with

  • Does anybody know if there's a reason (maybe permissions related?) that I don't have a file out node?
  • Can anyone describe a better method for saving this XML string to a .xml file?

Thanks for any help you can give everyone!

Sam

In your screen shot, the first node is the node that can write to a file.

You should give it an absolute path name, otherwise it will be relative to the working directory of the Node-RED process.

Thank you for such a quick response @knolleary!

I've tried with both absolute and relative path names, with and without folders and the combination of settings that should get the right result.

For example in the "Filename" field I've tried all of the following and still can't seem to get the file to be stored:

'/root/.node-red/files/file.xml' <- What I presumed the path would be?
'./root/.node-red/files/file.xml'
'../root/.node-red/files/file.xml'
'/var/www/html/file.xml'
'./var/www/html/file.xml'
'../var/www/html/file.xml'
'file.xml'

I don't have any output attached to the file node - do I need to wire that into an output node of some sort?

I've checked debugging panel and the actual "node-red" logs in Ubuntu and can't seem to locate anything.

I'm sure it's something simple I'm missing but maybe a combination of a long day and not much Linux knowledge is killing me off.

Thanks for any other advice you might be able to give me though!

I'm an idiot and managed to resolve it now.

I was sure the paths were right as I'd set up a test flow to ensure I could read a file from the same folder and that worked just fine...

For reference - I'd changed something further up the flow that ended up passing in a full object to the File node.

Thank you @knolleary for pointing me in the right direction!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.