I created a function that downloaded .txt files from an ftp server, using .net functions.
This works fine most of the times, but I have 1 particular error.
When the file is too small (less than 250 Bytes) and it ends with an empty line, i get the error :
Fout: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1814.
The reason is that the download adds several [NUL] values at the empty line. Below you see these values at the last line.
If I copy the fourth text line onto the fifth line, no [NUL] values will be added by the download.
This is the function :
Is the adding of the [NUL] values a setting, or am I doing something wrong in the function?
I tried it on several ftp servers, all the same error, so I do not think it's a setting on the server.
Comments
GetBuffer 'gets' also the unallocated bytes you could try with ToArray.
Good luck, let us know if it works out.
Thanks!
For us it has been some issues with file-names who has special signs as åäö ÅÄÖ but finally I found a solution..
Nav2013, Nav2013R2, Nav2015, Nav2016, ftp, dotnet, encoding, åäg
Christer in Stockholm, Sweden