Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.3k views
in .NET FTP by (120 points)
Hello,
I have problem when trying resume downloading file.
The problem is file isn't appending correctly.
As result I have file bigger than original.
It seems that files concatenates (not appends).

See my code below.

//_ftpConnection - SecureFTPConnection
//ftpFileName - path to file located on FTP server
//localFileName - path for downloading file

FileStream localFileStream = null;
if (File.Exists(localFileName))
{
    localFileStream = File.Open(localFileName, FileMode.Append, FileAccess.Write);
}
else
{
    localFileStream = new FileStream(localFileName, FileMode.CreateNew, FileAccess.Write);
}

_ftpConnection.ResumeTransfer();
_ftpConnection.DownloadStream(localFileStream, ftpFileName);
localFileStream.Close();


Thanks for your help.

Please log in or register to answer this question.

Categories

...