File corrupted

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.

Hello ..

Try to reproduce the problem with the SmartFTP client. It's highly unlikely that the file corruption originates from SmartFTP or the FTP Library component.

Regards,
Mat

thanks for the reply.

I tried, it works fine with the graphic client...

The SmartFTP client uses the FTP Library. Therefore the problem has to be somewhere else. Try to compare the logs from SmartFTP with your logs. For example SmartFTP automatically retries broken transfers and verifies if the file has been transferred sucessfully. Everything you can do with the FTP Library as well.

Regards,
Mat

This is the log of the graphic client, i do not see any difference. We will try today to make the transfer without SSL. Is there a chance the SSL is the source of the problem ?


[08:47:09] Remote file exist check: "Mvt_comptes_08_01_09.csv".
[08:47:09] TYPE I
[08:47:09] 200 Type set to I.
[08:47:09] SIZE Mvt_comptes_08_01_09.csv
[08:47:09] 550 Mvt_comptes_08_01_09.csv: No such file.
[08:47:09] File size check (SIZE) failed. File not found or permission denied.
[08:47:09] Estimated Compression Ratio of "E:\interface\xxx\sortant\xxx\donnees\archives\Mvt_comptes_08_01_09.csv": 13.55% (55,3 Ko/408 Ko)
[08:47:09] PASV
[08:47:09] 227 Entering Passive Mode (212,23,171,221,195,92).
[08:47:09] Opening data connection to 212.23.171.221 Port: 50012
[08:47:09] STOR Mvt_comptes_08_01_09.csv
[08:47:09] Connected. Exchanging encryption keys...
[08:47:09] 150 Opening BINARY mode data connection for Mvt_comptes_08_01_09.csv.
[08:47:09] Session Cipher: 128 bit RC4
[08:47:24] TLS encrypted session established.
[08:47:25] 76512 bytes transferred. (4,85 Ko/s) (00:00:15)
[08:47:25] 226 Transfer complete. 7543 bytes (76512 compressed @ 1014.34%) transferred. 5100 Actual Bps, 502 Effective Bps.
[08:47:25] MDTM 20080109034502 Mvt_comptes_08_01_09.csv
[08:47:25] 213 New file modification time is set: 20080109034502
[08:47:25] SIZE Mvt_comptes_08_01_09.csv
[08:47:25] 213 418010
[08:47:25] TYPE A
[08:47:25] 200 Type set to A.
[08:47:25] PASV
[08:47:25] 227 Entering Passive Mode (212,23,171,221,195,93).
[08:47:25] Opening data connection to 212.23.171.221 Port: 50013
[08:47:25] MLSD
[08:47:25] Connected. Exchanging encryption keys...
[08:47:25] 150 Opening BINARY mode data connection for MLSD /euralis/compte_adherent.
[08:47:25] Session Cipher: 128 bit RC4
[08:47:25] TLS encrypted session established.
[08:47:25] 967 bytes transferred. (10,1 Ko/s) (93 ms)
[08:47:25] 226 Transfer complete. 12299 bytes (988 compressed @ 8.03%) transferred. 988 Actual Bps, 12299 Effective Bps.
[08:47:25] Transfer successful.
[08:47:55] NOOP

Without the SSL, it works fine !

It looks like it is coming from the FTP Server (Globalscape) because we tried with other FTP client and have the same problem.

Instead of using SSL Implicit you should use SSL/TLS Explicit. This doesn't solve the problem with the GlobalScape server but it's something I noticed. Implicit SSL is deprecated and shouldn't be used anymore. The GlobalScape FTP server supports both implicit and explicit mode.

Regards,
Mat