-
-
Notifications
You must be signed in to change notification settings - Fork 969
Closed
Labels
Milestone
Description
Hi,
I am uploading a csv file to sftp. The file ends up corrupted.
After ~250 lines it reprints the column headers along with the first ~250 rows instead of the following ~250 rows then continues on with the rest of the file.
I have the same application deployed to multiple locations and only some locations exhibit this behavior. I log the output locally and can verify the output itself is correct.
Here is the upload code
var fileBytes = Encoding.UTF8.GetBytes(file);
var connectionInfo = new ConnectionInfo(_settings.FtpServer, _settings.FtpUserName, new PasswordAuthenticationMethod(_settings.FtpUserName, _settings.FtpPassword));
using (var client = new SftpClient(connectionInfo))
{
client.Connect();
client.WriteAllBytes($"{_settings.FtpPath}/{fileName}", fileBytes);
CsvLogger.Info(file);
}
I have also tried using client.OpenWrite and .Write instead and still the same issue.
Any advice would be appreciated
Thanks