lolo787520
your ftp lib is awesome .
i will be grateful if you can help me .
i build this code like your example
Private Sub upload_file_smartftp(local_name, onserver_file, 0, 0)
Dim nRestartLo: nRestartLo = 0
Dim nRestartHi: nRestartHi = 0
Dim strMsg As String
If objFTP.UploadFile(local_name, onserver_filw, nRestartLo, nRestartHi) = sfFTPLib.enumError.ftpErrorSuccess Then
strMsg = " Upload successful." & vbCrLf
Else
strMsg = "uploadFile failed. LastError = " & objFTP.LastError & vbCrLf
Call resume_UploadFile(local_name, onserver_filw, local_size, bResume)
End If
End Sub
'*****************************************************************************
Private Sub resume_UploadFile(strLocalFile, strRemoteFile, local_size, bResume)
Dim nRestart: nRestart = 0 ' overwrite by default
Dim bSkip: bSkip = False ' don't skip, unless equal size
Dim nLocalFileSize: nLocalFileSize = local_size
Dim result
' Get Remote File Size
result = objFTP.GetFileSize(strRemoteFile)
If result = ftpErrorSuccess Then
Dim nRemoteFileSize: nRemoteFileSize = objFTP.LastFileSizeLo
If nLocalFileSize = nRemoteFileSize Then
bSkip = True
' MsgBox (" file equal")
nRestart = 0
ElseIf nLocalFileSize > nRemoteFileSize Then
' Only resume if local size is greater than remote size
nRestart = nRemoteFileSize
End If
End If
' UploadFile
result = objFTP.UploadFile(strLocalFile, strRemoteFile, nRestart, 0)
If result = ftpErrorSuccess Then
bResume = True
Else
bResume = False
End If
End Sub
from some reason when i kick my connection the program start transfer from begining
i get 0 in result = objFTP.GetFileSize(strRemoteFile) even when i see this file in my browser and size>0
my server support resume (i try this in your client ftp 2 )
can you see any error in this code
Thank you for you patience
i will be grateful if you can help me .
i build this code like your example
Private Sub upload_file_smartftp(local_name, onserver_file, 0, 0)
Dim nRestartLo: nRestartLo = 0
Dim nRestartHi: nRestartHi = 0
Dim strMsg As String
If objFTP.UploadFile(local_name, onserver_filw, nRestartLo, nRestartHi) = sfFTPLib.enumError.ftpErrorSuccess Then
strMsg = " Upload successful." & vbCrLf
Else
strMsg = "uploadFile failed. LastError = " & objFTP.LastError & vbCrLf
Call resume_UploadFile(local_name, onserver_filw, local_size, bResume)
End If
End Sub
'*****************************************************************************
Private Sub resume_UploadFile(strLocalFile, strRemoteFile, local_size, bResume)
Dim nRestart: nRestart = 0 ' overwrite by default
Dim bSkip: bSkip = False ' don't skip, unless equal size
Dim nLocalFileSize: nLocalFileSize = local_size
Dim result
' Get Remote File Size
result = objFTP.GetFileSize(strRemoteFile)
If result = ftpErrorSuccess Then
Dim nRemoteFileSize: nRemoteFileSize = objFTP.LastFileSizeLo
If nLocalFileSize = nRemoteFileSize Then
bSkip = True
' MsgBox (" file equal")
nRestart = 0
ElseIf nLocalFileSize > nRemoteFileSize Then
' Only resume if local size is greater than remote size
nRestart = nRemoteFileSize
End If
End If
' UploadFile
result = objFTP.UploadFile(strLocalFile, strRemoteFile, nRestart, 0)
If result = ftpErrorSuccess Then
bResume = True
Else
bResume = False
End If
End Sub
from some reason when i kick my connection the program start transfer from begining
i get 0 in result = objFTP.GetFileSize(strRemoteFile) even when i see this file in my browser and size>0
my server support resume (i try this in your client ftp 2 )
can you see any error in this code
Thank you for you patience