I noticed a bug (I belive it is). When I try to sync a file that is smaller then the file on the SFTP, it seems it upload the file, but in reality its not.
Uploading a smaller file from local HDD to SFTP where a larger file is present - Not Working
Uploading a larger file from local HDD to SFTP where a smaller file is present - Working
Uploading a file that dosnt exists on SFTP - Working.
My quick fix is to delete the SFTP file first (if exists)
I use the following code to upload a file:
Handle := FSFTPClient.OpenFile(RemotePath + RemoteFile, fmCreateNew, , [bmWrite, bmDelete], [amWriteData]);
BufSize := (High(Word)+1) * ((BUF_SIZE * 1024 * 1024) div High(Word));
FileOffset := 0;
BufSize := 0;
PartUploadDataProc(Buf, BufSize, EOF);
FSFTPClient.WriteFile(Handle, FileOffset, Buf, 0, BufSize);
EOF = True;