How to resume upload on a large file using SFTP?

We are using SmartFTP Library Version 2.0.107.0. We are trying to resume upload of file of size 8GB using SFTP over SSH connection. The code we are using is as follows:

_objSFTP.UploadFile(fileName, fileName, LocalfileLowValue, 0, ServerfileLowValue, 0) = sfFTPLib.enumError.ftpErrorSuccess

The problem is when the start byte of the file is a large value. The function "UploadFile" accepts only integer values for low and high and if the size of the start byte is in GB then we cant use an integer. Can anyone tell me how I can resume uploading of a large file over an SFTP connection?

Split up your 64-bit integer into a lower and higher 32-bit part. Then pass it to the function.

Dim value As System.UInt64
value = 342342323423432;
Dim hi As System.UInt32
hi = System.Convert.ToUInt32(value >> 32)
Dim lo As System.UInt32
lo = System.Convert.ToUInt32(value)

UploadFile(file1, file2, lo, hi, lo, hi)

file1 != file2

I have tried the solution you gave for the problem but still I am still getting the same error. The exact size of file which I want to upload is 9127565312 bytes and I am resuming upload from 2548465664 bytes so the code is:

Dim value As System.UInt64
value = 2548465664;
Dim hi As System.UInt32
hi = System.Convert.ToUInt32(value >> 32)
Dim lo As System.UInt32
lo = System.Convert.ToUInt32(value)

However when we are calling the function as:

UploadFile(file1, file2, lo, hi, lo, hi)

The line gives the error "Arithmetic operation resulted in an overflow"

Please install the latest build: https://www.smartftp.com/ftplib/download

Then use the new UploadFileEx() function:

Dim startPosition As System.UInt64
startPosition = 2548465664;
UploadFileEx(file1, file2, startPosition)