Page 1 of 1

TScSFTPClient.UploadFile error in uploading a file

Posted: Wed 19 Oct 2022 07:16
by wg961423
When the server already has the same file name and it is incomplete and needs to be appended, the 3rd parameter of UploadFile is set to false and the upload file will have an error, the file size is fine but the first half of the file is set to 0 and the appended content is placed at the end of the file.

After tracing the code, the code in the TScSFTPClient.OpenAndUploadFile function OpenModes := [foWrite, foCreate, foExcl]; needs to be changed to OpenModes := [foWrite, foCreate, foAppend]; to be able to properly Append the file.