euralis
Hi,
I try to send 3 files with the libray (vbs) on ftps (SSL/TLS).
For 2 of them, no problems but the third one is corrupted, that means i got some lines missing, other in wrong place, etc...
I first thought it was due to the ASCII mode, then i used the Binary mode but i still have the problem.
Here is the script, it cannot be more simple:
site = WScript.Arguments(0)
fichier_source = WScript.Arguments(1)
fichier_cible = WScript.Arguments(2)
Dim obj
Set obj = CreateObject("sfFTPLib.FTPConnectionSTA")
obj.Host = site
obj.Username = ""
obj.Password = ""
obj.Port = 990
obj.Protocol = 1 ' ftpProtocolSSLImplicit
obj.Passive = 1
' Enable logging
obj.LogFile = "put_smart_ftp.log"
ret = obj.Connect()
'set BINARY Mode
obj.DataTransferType = 2 ' ftpDataTransferTypeImage
If ret = ftpErrorSuccess Then
WScript.Echo "Connect() successful." & vbCrLf
If obj.UploadFile(fichier_source,fichier_cible,0,0) = ftpErrorSuccess Then
WScript.Echo "ENVOIEOK"
Else
WScript.Echo "ENVOIEKO"
End if
Else
WScript.Echo "Connect() failed. Error = " & ret & vbCrLf
WScript.Echo "ENVOIEKO"
End If
And the log, i replaced information by xxx sometimes:
[20080108 13:45:17] Connecting to xxx Port: 990
[20080108 13:45:17] Connected to xxx.
[20080108 13:45:17] Connected. Exchanging encryption keys...
[20080108 13:45:18] Session Cipher: 128 bit RC4
[20080108 13:45:33] TLS encrypted session established.
[20080108 13:45:33] 220 GlobalSCAPE Secure FTP Server
[20080108 13:45:33] USER xxx
[20080108 13:45:33] 331 Password required for euralis.
[20080108 13:45:33] PASS xxx
[20080108 13:45:33] 230 Login OK. Proceed.
[20080108 13:45:33] SYST
[20080108 13:45:33] 215 UNIX Type: L8
[20080108 13:45:33] Detected Server Type: UNIX
[20080108 13:45:33] FEAT
[20080108 13:45:33] 211-Features supported:
[20080108 13:45:33] COMB target;source_list
[20080108 13:45:33] REST STREAM
[20080108 13:45:33] SIZE
[20080108 13:45:33] MDTM
[20080108 13:45:33] XCRC filename;start;end
[20080108 13:45:33] SSCN
[20080108 13:45:33] MLST Size*;Modify*;Create;Type*;Unique;Perm*;Lang;Media-Type;CharSet;
[20080108 13:45:33] MODE Z
[20080108 13:45:33] 211 END
[20080108 13:45:33] Detected Server Software: GlobalSCAPE Secure FTP Server
[20080108 13:45:33] PWD
[20080108 13:45:33] 257 "/xxx" is current folder.
[20080108 13:45:33] TYPE I
[20080108 13:45:33] 200 Type set to I.
[20080108 13:45:33] PBSZ 0
[20080108 13:45:33] 200 PBSZ Command OK. Protection buffer size set to 0.
[20080108 13:45:33] PROT C
[20080108 13:45:33] 200 PROT Command OK. Using Clear data connection
[20080108 13:45:33] PASV
[20080108 13:45:33] 227 Entering Passive Mode (xxx).
[20080108 13:45:33] Opening data connection to x Port: 50028
[20080108 13:45:33] STOR /xxx/compte_adherent/Mvt_comptes_08_01_08.csv
[20080108 13:45:33] 150 Opening BINARY mode data connection for /xxx/compte_adherent/Mvt_comptes_08_01_08.csv.
[20080108 13:45:34] 407353 bytes transferred. (299 Ko/s) (00:00:01)
[20080108 13:45:34] 226 Transfer complete. 407353 bytes transferred. 407353 Bps.
I try to send 3 files with the libray (vbs) on ftps (SSL/TLS).
For 2 of them, no problems but the third one is corrupted, that means i got some lines missing, other in wrong place, etc...
I first thought it was due to the ASCII mode, then i used the Binary mode but i still have the problem.
Here is the script, it cannot be more simple:
site = WScript.Arguments(0)
fichier_source = WScript.Arguments(1)
fichier_cible = WScript.Arguments(2)
Dim obj
Set obj = CreateObject("sfFTPLib.FTPConnectionSTA")
obj.Host = site
obj.Username = ""
obj.Password = ""
obj.Port = 990
obj.Protocol = 1 ' ftpProtocolSSLImplicit
obj.Passive = 1
' Enable logging
obj.LogFile = "put_smart_ftp.log"
ret = obj.Connect()
'set BINARY Mode
obj.DataTransferType = 2 ' ftpDataTransferTypeImage
If ret = ftpErrorSuccess Then
WScript.Echo "Connect() successful." & vbCrLf
If obj.UploadFile(fichier_source,fichier_cible,0,0) = ftpErrorSuccess Then
WScript.Echo "ENVOIEOK"
Else
WScript.Echo "ENVOIEKO"
End if
Else
WScript.Echo "Connect() failed. Error = " & ret & vbCrLf
WScript.Echo "ENVOIEKO"
End If
And the log, i replaced information by xxx sometimes:
[20080108 13:45:17] Connecting to xxx Port: 990
[20080108 13:45:17] Connected to xxx.
[20080108 13:45:17] Connected. Exchanging encryption keys...
[20080108 13:45:18] Session Cipher: 128 bit RC4
[20080108 13:45:33] TLS encrypted session established.
[20080108 13:45:33] 220 GlobalSCAPE Secure FTP Server
[20080108 13:45:33] USER xxx
[20080108 13:45:33] 331 Password required for euralis.
[20080108 13:45:33] PASS xxx
[20080108 13:45:33] 230 Login OK. Proceed.
[20080108 13:45:33] SYST
[20080108 13:45:33] 215 UNIX Type: L8
[20080108 13:45:33] Detected Server Type: UNIX
[20080108 13:45:33] FEAT
[20080108 13:45:33] 211-Features supported:
[20080108 13:45:33] COMB target;source_list
[20080108 13:45:33] REST STREAM
[20080108 13:45:33] SIZE
[20080108 13:45:33] MDTM
[20080108 13:45:33] XCRC filename;start;end
[20080108 13:45:33] SSCN
[20080108 13:45:33] MLST Size*;Modify*;Create;Type*;Unique;Perm*;Lang;Media-Type;CharSet;
[20080108 13:45:33] MODE Z
[20080108 13:45:33] 211 END
[20080108 13:45:33] Detected Server Software: GlobalSCAPE Secure FTP Server
[20080108 13:45:33] PWD
[20080108 13:45:33] 257 "/xxx" is current folder.
[20080108 13:45:33] TYPE I
[20080108 13:45:33] 200 Type set to I.
[20080108 13:45:33] PBSZ 0
[20080108 13:45:33] 200 PBSZ Command OK. Protection buffer size set to 0.
[20080108 13:45:33] PROT C
[20080108 13:45:33] 200 PROT Command OK. Using Clear data connection
[20080108 13:45:33] PASV
[20080108 13:45:33] 227 Entering Passive Mode (xxx).
[20080108 13:45:33] Opening data connection to x Port: 50028
[20080108 13:45:33] STOR /xxx/compte_adherent/Mvt_comptes_08_01_08.csv
[20080108 13:45:33] 150 Opening BINARY mode data connection for /xxx/compte_adherent/Mvt_comptes_08_01_08.csv.
[20080108 13:45:34] 407353 bytes transferred. (299 Ko/s) (00:00:01)
[20080108 13:45:34] 226 Transfer complete. 407353 bytes transferred. 407353 Bps.