Reading file content from downloaded file

Describe the issue/error/question

I can’t figure out how to download a file with FTP node and access the content of that file. I get the file in the node window and can manually click download file. I have tried the binary to json node, and all other nodes regarding files, but it doesn’t work for me.

Main goal is to FTP to a server, read and manipulate content of a file, and put it back to the server. The simplest way to do the file content manipulation, is via simple js, therefore I would really like to have the content of the file in the flow.

I run n8n via docker on server.

Any help or link to an example would be much appreciated :smile:

Hey @Brian_Andersen,

Welcome to the community :rocket:

When you tried to read the binary data do you get any error messages? What type of file is it as well as that could be a part of the issue.

It was a .htaccess file, but i swaped it for a txt file now, to debug… But same result… Maybe there is just something in the flow I don’t understand. I have a Start->Set->FTP this works, as you can see on image, but i would like to change the content of the file.

Hi @Brian_Andersen,

In some cases, disabling the “Set All Data” has helped me. The “unexpected token” seems to be the error message which is thrown internally. There seems to be an occasional parsing problem. Or @Jon can explain when “Set All Data” works and when it doesn’t…

3 Likes

OMG it works :smiley: I can’t believe I didn’t try that…
Thanks so much for super fast response!

2 Likes

I am very happy if I could help you further :partying_face: