SFTP bug downloading empty files with extension

Hello.

When i try to download with FTP node an empty file with a peculiar extension it throws an error:

ERROR: Expected the input argument to be of type Uint8Array or Buffer or ArrayBuffer, got object

Steps to reproduce:

Create an empty txt file.

empty.txt

Try to download it with FTP node. It downloads fine.

Rename that file to empty.dat

Try to download again. It throws the error

ERROR: Expected the input argument to be of type Uint8Array or Buffer or ArrayBuffer, got object

Why is that? We need to download these files although they are empty.

In hex view you can see they are identical

.txt

.dat

But the .dat throws the error i mentioned above.

Hey @Mulen,

Just done a quick test here and I have reproduced the same issue, Even though you put SFTP in the title I did a test with FTP as well and that is working so I assume it is something different about the library being used for SFTP or how the returned data is handled.

Yes sorry i tried only with sftp.

So it’s a minor bug then that exists. Hope the devs pick it up.

Thanks.

Thanks for reporting this Mulen!

Seeing this is an empty file, would you be able to simply create it yourself instead of downloading for the time beeing?

For example like so:

1 Like

That actually works well @MutedJam, Using that example I have put together a more complete example.

We list the files, Check if it is .dat and if it is check for 0 size we then either make an empty binary file and save it or download it from the SFTP server.

Example Workflow
2 Likes

I have a complex workflow and before the files are downloaded i managed to add a new line to empty files with a bash script so that the ftp node does not produce that error for the time being.

Thank you.

2 Likes

Thank you i will look into it too. Great!