Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in .NET FTP by (120 points)
I am using the FTP component in a .NET Windows Service. The service has a timer that cycles every 24 hours, and takes a MS SQL Server backup file and FTPs it to another server for safe keeping. If I remove the .BAK backup files and put a text file or somethign in the directory, it works ok. However if there is a .BAK file it errors with the exception below. What can I do? Thanks, -Bret


System.ArgumentException: Found a low surrogate char without a preceding high surrogate at index: 386. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters. Parameter name: chars at EnterpriseDT.Net.Ftp.FTPClient.PutASCII(Stream srcStream, String remoteFile, Boolean append) at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile, Boolean append) at EnterpriseDT.Net.Ftp.FTPClient.Put(String localPath, String remoteFile) at SQLBackupService.Service1.Timer1_Elapsed(Object sender, ElapsedEventArgs e)

1 Answer

0 votes
by
This should only happen if you are using ASCII transfer mode. If you use binary transfer mode you shouldn't get this error. Is it feasible to use binary transfers instead?

- Hans (EDT)

Categories

...