Hi Team, i am trying to download the sftp files, after download the files by using sftp download node, this output saves as binary data so i have used the Write file from desk node for download the original file but after execute the workflow it won’t download the exact file. i have attached the screenshot please let me know what i need to do?
-this output file
1 Like
@Kaviya_V have you tried using the read/write file node’s Input Binary Field being set to match the exact binary field name output by the SFTP download node? and using an absolute file path ofc, and i suppose with your previous question this file path is added to N8N_RESTRICT_FILE_ACCESS_TO so that n8n can access it. let me know if that works.
Hi @Anshul_Namdev
yes i have used same binary filed as data in both sftp download node and write file from desk node and give path to N8N_RESTRICT_FILE_ACCESS_TO but still not working.
1 Like
@Kaviya_V Umm… maybe try this, set that input binary field in the write file node to exactly match the one FTP/SFTP node outputs something like data although those two i have proposed should have fixed the issue, let me know if that works
if actually nothing works we can also move to FTP if we only need to get the file else lets try debugging this.
If Anshul’s binary field suggestions still aren’t working, a few things to check: verify the file isn’t getting corrupted during the binary conversion step (enable workflow debug output to inspect the actual bytes), confirm your N8N_RESTRICT_FILE_ACCESS_TO path has proper write permissions, and check if the SFTP server is sending file metadata that might interfere with the write. FTP fallback is solid if SFTP continues to be problematic — sometimes simpler protocols avoid these encoding edge cases.
Hi if i am given the which filename to download in write file from desk, it will download the files ex:D:\N8n\files\American General 7-13-18 1000011956.xls but if i given the filename dynamically, it will not download the file ex:D:\N8n\files{{ $json.name }}. i have attached the screenshot, please check it
1 Like
Hi @Kaviya_V There are some common issues like expression containing extra space and file path missing separators, your screenshot confirms both of them are not here, as you have said that dynamically it is not working else it works, consider using a codeNode to combine that file path with the dynamic filename and then enter that full path here in the file path field that will work.