Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unreliable data transmission!! URGENT!!!
Message
De
04/09/2002 23:08:40
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Unreliable data transmission!! URGENT!!!
Divers
Thread ID:
00696950
Message ID:
00696950
Vues:
64
Hi,
I am upload and download files by using wwFTP.
I face problem that, the files uploaded/downloaded become invalid sometime.
What will cause the unrealiable transmission?
The followng is the code of my FTP:
lnRetVal = loFTP.FTPSendFileEx(lcFromPath + lcFileName, ; lcToPath + "/" + JUSTFNAME(lcFileName))

DEFINE CLASS CU_wwFTP AS wwFTP
oProgressForm = .NULL.
cProgressFormClass = "wwProgressForm"
nCurrFileSize = 0
nTotalFiles = 0
nCurrFileIndex = 0
lShowDialog = .F.
nTransferType = 0

PROCEDURE OnFTPBufferUpdate
LPARAMETER lnBytesDownloaded,lnBufferReads,lcCurrentChunk

LOCAL loProgressForm

WITH THIS 
DO CASE
CASE lnBufferReads = 1
DO CASE
CASE .nCurrFileSize > 90000
.nFTPWorkBufferSize = 16484
CASE .nCurrFileSize > 40000
.nFTPWorkBufferSize = 8182
ENDCASE
CASE (lnBufferReads < 0 AND .nCurrFileIndex = .nTotalFiles)
.oProgressForm = .NULL.
RETURN
ENDCASE

IF .lShowDialog
IF ISNULL(.oProgressForm)
.oProgressForm = CREATEOBJECT(.cProgressFormClass)
.oProgressForm.SetCaption("File Transfer")
.oProgressForm.ShowCancelButton()
.oProgressForm.Show()
ENDIF

.oProgressForm.SetDescription(IIF(.nTransferType = 1, "Received from ", ;
"Sent to ") + .cserver + ":" + CHR(13) + ;
LTRIM(STR(.nCurrFileIndex)) + " of " + LTRIM(STR(.nTotalFiles)) + ;
" file(s) " + CHR(13) + ;
LTRIM(TRANSFORM(lnBytesDownloaded,"999,999,999,999")) + " of " + ;
LTRIM(TRANSFORM(.nCurrFileSize,"999,999,999,999"))+ " bytes")

.oProgressForm.SetProgress(lnBytesDownloaded / .nCurrFileSize * 100)

DOEVENTS

IF .oProgressForm.lCancelled
.lCancelDownload = .T.
ENDIF
ENDIF
ENDWITH
ENDPROC
ENDDEFINE
Any ideas?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform