PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → [WM22] a question about FTP transfert
[WM22] a question about FTP transfert
Débuté par VEGEboss, 29 mar. 2018 17:21 - Aucune réponse
Membre enregistré
88 messages
Popularité : +2 (2 votes)
Posté le 29 mars 2018 - 17:21
please consider this portion of code, wrote to send ALL the files
found in a folder to a FTP server. very easy. ther's a "debug" call
to the "Info" function that shows the good (or not) result of the
operation

MyFTP is int
FTPresult is boolean

MyFTP = FTPConnect(<site>, <user>, <password>, bla bla bla)

IF MyFTP = -1 THEN
Info("FTP Connection not available. Try later!")
ELSE
FTPresult = FTPSend(MyFTP, <path>, <ftp site>", myGauge)
Info(FTPresult)
FTPresult = FTPDisconnect(MyFTP)
END


and a Local procedure to see the progress of the transmission

Procedure myGauge (nTotal, nCurrent)
ToastDisplay( NumToString(nCurrent / nTotal * 100, "3,2f") + "%", toastShort , vaTop, haCenter)
RESULT True


thanks to the "myGauge" procedure call, I can show to the user the
progress of the FTP work, BUT I read the result = 100% (with the Info) BEFORE the transmission
REALLY ends. e.g.: the gauge still says "50%" and the info shows me the value of the FTPresult
variable to true, and the gauge still runs.
I'm monitoring the files arrived on the server and I can see that NOT ALL the files
are finished, so I think that the FTPSend works "asyncronous" and result as finished (and
gives me back the control to the app) BEFORE the send is really completed

now, the question: how can I know if a FTP Connection is working?